New answers tagged temp-tables
As it turned out the default value of query_cache_type changed to OFF with MySQL 5.6.8. Before that the default was ON. See https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_query_cache_type
There are several reasons why that could be happening, and it is very difficult to point one specific cause -it could be because a change on the query optimizer, bad query statistics, parameters whose defaults changed from version to version, the changes on replication format, the data types you are handling, a change on the row format, etc. The critical ...
I would add a second column to the clustered index statement, make it be CREATE CLUSTERED INDEX IX_Temp_OBJECT_CD ON #Temp (OBJECT_CD, CD) That may help, depending on how many CD's there are to OBJECT_CD's.
Top 50 recent answers are included