Answer the question
In order to leave comments, you need to log in
Why does the query take 10 times longer to complete?
Accidentally typoed and instead of:
it turned out:
SELECT * FROM files WHERE parsing_status IS NULL
SELECT * FROM files WHERE parsing_status IS NULL AND parsing_status IS NULL
Answer the question
In order to leave comments, you need to log in
Just a guess:
It looks like you're doing a Cartesian product of the files table, as if you joined the table to itself without a condition. As a result, the selection occurs by the square of the number of records, i.e. instead of 10 records, 100 will be processed, and instead of 1000 - 1000000.
I would venture to suggest that the oversimplification of the typo hides important details.
Still, it is worth giving samples of two complete queries (well, and then, apparently, the structure of index tables)
Naturally, if the experiment is repeated - 10 times out of 10 in any order, the ratio of execution time is preserved.
And by itself after comparison of plans of execution of these requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question