Last active
October 30, 2020 11:38
-
-
Save mgttt/5b5fe34923808cc70bc09d55cc0ce86c to your computer and use it in GitHub Desktop.
mysql table size etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS,DATA_LENGTH,INDEX_LENGTH FROM information_schema.TABLES | |
| where DATA_LENGTH+INDEX_LENGTH >0 and TABLE_SCHEMA not in ('mysql','sys','information_schema'); | |
| select * from information_schema.TABLES limit 1; |
Author
Author
TODO: GROUP BY COL
=>
if count(*)>ct_manually then:
manually tick needed; or sampling
else:
count (<max_count) or manually tick => do group table :
call build_col_rpt(col)
Author
SELECT table_schema, table_name, engine, table_rows,update_time,avg_row_length FROM information_schema.tables
WHERE table_schema NOT IN ('mysql','sys','information_schema','performance_schema')
ORDER BY table_rows * avg_row_length DESC;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
select CONCAT(TABLE_SCHEMA,'.',TABLE_NAME) TBL, COLUMN_NAME as
col, DATA_TYPE astypefrom information_schema.columns where TABLE_SCHEMA not in ('mysql','sys','information_schema','performance_schema') limit 100;select count(*) from information_schema.columns where TABLE_SCHEMA not in ('mysql','sys','information_schema','performance_schema')