i would like to know if limit and offset are executed after the row were selected:
SELECT * FROM users WHERE id > 4 LIMIT 0,90 ORDER BY datetime DESC;
Does this query first selects all the users's rows then apply the LIMIT, or does this query first apply the LIMIT then selects the users's rows?
The FROM clause is the first to be executed in the query, then the WHERE clause. After that the LIMIT clause is applied.
So, the following are the Logical query processing steps for the query you posted:
FROM clause return all users.WHERE clause is applied. Only the users with id > 4 get passed to the next step.LIMIT. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With