ホームページ >データベース >mysql チュートリアル >MySQL新旧版本ORDER BY 处理方法_MySQL
mysql> select truncate(@@sort_buffer_size/1024/1024,2)||'MB' as 'sort_buffer_size',truncate(@@read_rnd_buffer_size/1024/1024,2)||'MB' as read_rnd_buffer_zie,@@max_length_for_sort_data as max_length_for_sort_data;+------------------+---------------------+--------------------------+| sort_buffer_size | read_rnd_buffer_zie | max_length_for_sort_data |+------------------+---------------------+--------------------------+| 2.00MB | 2.00MB | 1024 |+------------------+---------------------+--------------------------+1 row in set (0.00 sec)
mysql> select table_name,table_rows,concat(truncate(data_length/1024/1024,2),'MB') as 'table_size' from information_schema.tables where table_name = 't1' and table_schema = 't_girl';+------------+------------+------------+| table_name | table_rows | table_size |+------------+------------+------------+| t1 | 2092640 | 74.60MB |+------------+------------+------------+1 row in set (0.00 sec)
mysql> SET OPTIMIZER_TRACE="enabled=on",END_MARKERS_IN_JSON=on;Query OK, 0 rows affected (0.00 sec)
mysql> select * from information_schema.optimizer_trace/G*************************** 1. row *************************** QUERY: select * from t1 where id " } /* filesort_summary */ } ] /* steps */ } /* join_execution */ } ] /* steps *