B
B
baimkin2018-12-06 12:18:55
SQLite
baimkin, 2018-12-06 12:18:55

How to speed up Update SQLite?

Have a request

UPDATE qTable SET n = (SELECT COUNT(sP) FROM sTable WHERE sTable.uID = 181206113231
 AND sP = qTable.id GROUP BY sP);

on 20 thousand rows, it runs for almost a minute, which is very long, despite the fact that the SELECT subquery
SELECT COUNT(sP) FROM sTable, qTable. WHERE sTable.uID = 181206113231
 AND sP = qTable.id GROUP BY sP

runs in 0.006 seconds
Tell me how to speed up Update?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question