News for hackers. Stuff that matters.
Re:SQL Anti-Patterns You Should Avoid by sgarland on Saturday October 18, 2025 @08:36PM (#45631337)
If you include an ORDER BY, the DB _may_ continue searching. MySQL (and, I assume, MS SQL Server, since it also can cluster the PK) can stop early in some circumstances.

But if you just have a LIMIT, then no - any RDBMS should stop as soon as it’s reached your requested limit.

Re:SQL Anti-Patterns You Should Avoid by dotancohen on Saturday October 18, 2025 @10:06PM (#45631627)
Right, that's why I add it.