Optimization of SELECT * and select fields.
Let's start with a test, I have 260,000 records in my test database.
Check the number of columns again:
SELECT COUNT (*) from Information_schema.columns WHERE table_schema= "Lezhi_data ' and table_name= ' Demo_jobs_store ';
The return is 43 columns. This number as a test data should be able to have a preliminary effect.
Let's try the Select field first to find out how much response time is:
We can see that the execution of a field is 7.724 seconds.
Let's do two more fields to see how it works.
Two fields, the time is 15 seconds.
Let's be ruthless and add a few more fields. < yo "http://www.2cto.com/kf/ware/vc/" target= "_blank" class= "Keylink" >vcd4kpha+pgltzybzcmm9 "http://" Www.2cto.com/uploadfile/Collfiles/20140331/2014033109075048.jpg "alt=" ">
We can see the time directly to 29 seconds.
From the above we can see the great difference in execution time. PS, my first picture of the red box is wrong.
So in the actual application process, we try to select the fields we need.