I have a table named
app with millions of lines.
When running a query such as:
select * from (select * from app) as temp;
We get the following:
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_3bb_0.MYI'; try to repair it
This is because the remaining space on the machine is filled up =
0 MB free.
create table app2 as select * from app; however works - it increases disk usage but does not reach 100%.
Why does creating the same table with the same data again use less memory than the temporary table above?