CREATE TABLE t1 ( d datetime default NULL ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'); flush status; select * from t1 group by d; d 2002-10-24 14:50:32 2002-10-24 14:50:33 2002-10-24 14:50:34 2002-10-24 14:50:35 2002-10-24 14:50:36 2002-10-24 14:50:37 2002-10-24 14:50:38 2002-10-24 14:50:39 2002-10-24 14:50:40 show status like "created_tmp%tables"; Variable_name Value Created_tmp_disk_tables 0 Created_tmp_tables 1 drop table t1; DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1(a INT) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK INSERT INTO t1 VALUES (1), (2), (3); REPAIR TABLE t1; Table Op Msg_type Msg_text test.t1 repair status OK DROP TABLES t1;