Databases · Senior · Question 56 of 75

Why can a LIMIT query sometimes be slower than the same query without LIMIT?

Explanation

This happens with skewed or correlated data. Better statistics, a composite index matching filter and order, or rewriting the query helps.

Further reading

Problem with a question

Databases · Senior · question 56

Test yourself

Take the Databases · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz