I have a query, after running it if i run the show status in the same session like below
show status where Variable_name like ‘%Created_tmp_disk_tables%’;
It got incremented by one value. So it means temporary table is created on disk right? Not sure whether it is correct or not.
But if I enable profiling for that query. Below is the status I got.
- “starting”:”0.000246″,
- “checking permissions”:”0.000035″,
- “Opening tables”:”0.000098″,
- “System lock”:”0.000044″,
- “init”:”0.000209″,
- “optimizing”:”0.000075″,
- “statistics”:”0.000336″,
- “preparing”:”0.000138″,
- “Creating tmp table”:”0.000435″,
- “executing”:”0.000038″,
- “Copying to tmp table”:”2.923929″,
- “Sorting result”:”0.267926″,
- “Sending data”:”0.000945″,
- “end”:”0.000071″,
- “removing tmp table”:”0.077263″,
- “query end”:”0.000022″,
- “closing tables”:”0.000055″,
- “freeing items”:”0.000092″,
- “logging slow query”:”0.000074″,
- “cleaning up”:”0.000022″
Here I have found Copying to tmp table but not Copying to tmp table on disk.
Why there is a conflict between these two?
Whether Show status variable is correct or profiling is correct?
Need to know whether temporary table is created on disk or not.