Showing results for 
Search instead for 
Did you mean: 

Insert into temporary table is slower than just select these data

We are recently migrated from 5.6 to 5.7 (I know, the last call before 5.6 EOL), and I noticed one difference in 5.7 which was not in 5.6.

I'm creating a temporary table in the procedure and then populating it with Select statement. Then, in 5.6 the timing for just Select and for Insert into temp_table Select was the same, but in 5.7 I see it doubled (example, 3 sec for Select, and 6 sec for Insert into temp_table Select ... ). The code is unchanged, datatypes of fields are matching, temporary table has no primary key (adding it did not change timing), why such result?


There was a similar problem when I worked on the True Blue casino website tried various ways to fix it, and rolled back to the previous update helped. I'm not sure if there is any other way.