All my question is the title above.
Actually I want to know how limit
works in mysql? suppose this table:
// colors
+----+-------+
| id | color |
+----+-------+
| 1 | blue |
| 2 | red |
| 3 | green |
| 4 | white |
| 5 | grey |
| 6 | brown |
| 7 | black |
| 8 | pink |
+----+-------+
As you know id
column is unique (it is PK). And this is my query:
SELECT color FROM colors WHERE id = 5;
Now I want to know, would query above be more efficient if I use LIMIT 1
in the end of that?