+ 1
Is there any major reason why we should use LİMİT when retrieving records?
2 Respuestas
+ 7
It works best to prevent the strain on database server by users who only use the query to view few rows.
Example: You never go to the second page of google results, so why bother the database with more than what you will use?
And I mostly use LIMIT to check if my codes work in smaller row numbers, too.
Tables with millions of rows do take time and also some toll on the performance of the working database server. So limiting the query by 100 to check the integrity, then running the code seems more plausible to me.
Also Select TOP X columns From table works wonders.
0
Think about this, if you wanna sort out the only three person who score the most in a swiming championship, say u wanna grand them gold, silver, bronze medals, u sort the scores in descending order, then use the SELECT...LIMIT 3