How to find the current size (in memory) of a table?

I have a table with memory specified using engine = MEMORY. Which team can I run to find out how much space it takes now? How about maximum size?

+3
source share
2 answers
SHOW TABLE STATUS LIKE 'tablename'\G

Where tablename is the name of the table you want to check.

+5
source
SELECT data_length+index_length table_size
FROM information_schema.tables
WHERE table_schema='whateverdatabase'
AND table_name='whatevertablename*'
AND engine IS NOT NULL;

This works for any table; does not work with views (IS NULL engine).

+4
source

Source: https://habr.com/ru/post/1755412/


All Articles