What is difference between SELECT * FROM table
and SELECT * FROM table WHERE 1
Query 1:
SELECT * FROM table
- Number of records : 103
- Load time : 0.0005 sec
Query 2:
SELECT * FROM table WHERE 1
- Number of records : 103
- Load time : 0.0003 sec
Question 1 : What is the difference between these 2 queries, if it loads the same data.
Question 2 : Why there is these much time difference, if it loads the same data.
Question 3 : Why
phpmyadmin
by default loadsSELECT * FROM table WHERE 1
query ?Question 4 :What MySQL do for ABOVE queries in MySQL Query Caching?
Note :
- The difference is minor here because number of records are small (103),
but when number of records increases then time difference is also increase.
- So let's when we have 100000 number of records then we can see notable time difference.