Skip to content

Instantly share code, notes, and snippets.

@andypost
Last active March 28, 2019 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andypost/08818adcca7d8e747d37bbd07658dd7c to your computer and use it in GitHub Desktop.
Save andypost/08818adcca7d8e747d37bbd07658dd7c to your computer and use it in GitHub Desktop.
mysql> SELECT
-> sum(stat_value) pages,
-> index_name,
-> sum(stat_value) * @@innodb_page_size size
-> FROM
-> mysql.innodb_index_stats
-> WHERE
-> table_name LIKE 'locales_source'
-> AND database_name = 'd8'
-> AND stat_description LIKE 'Number of pages in the index'
-> GROUP BY
-> index_name;
+-------+----------------+---------+
| pages | index_name | size |
+-------+----------------+---------+
| 97 | PRIMARY | 1589248 |
| 97 | source_context | 1589248 |
+-------+----------------+---------+
2 rows in set (0.00 sec)
mysql> select count(0) from locales_source;
+----------+
| count(0) |
+----------+
| 13803 |
+----------+
1 row in set (0.11 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment