Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created May 29, 2015 02:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoku0825/dc57d1937e08bcb68069 to your computer and use it in GitHub Desktop.
Save yoku0825/dc57d1937e08bcb68069 to your computer and use it in GitHub Desktop.
mysql56> SELECT table_name, index_name, sum(number_records) FROM information_schema.innodb_buffer_page WHERE table_name = '`d1`.`t1`' GROUP BY 1, 2;
Empty set (0.04 sec)
mysql56> SELECT 1 FROM d1.t1 FORCE INDEX(val);
..
10000 rows in set (0.01 sec)
mysql56> SELECT table_name, index_name, sum(number_records) FROM information_schema.innodb_buffer_page WHERE table_name = '`d1`.`t1`' GROUP BY 1, 2;
+------------+------------+---------------------+
| table_name | index_name | sum(number_records) |
+------------+------------+---------------------+
| `d1`.`t1` | num | 127 |
| `d1`.`t1` | val | 10030 |
+------------+------------+---------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment