1 Answer
- Newest
- Most votes
- Most comments
0
Hi Koyla,
I am not sure if the query that you are using is correct or not but try to use the query as mentioned below to get the idea of how much space is free in the database and try to get the same information from both reader and writer endpoints.
SELECT
table_schema AS 'Db Name',
Round( Sum( data_length + index_length ) / 1024 / 1024, 3) AS 'Db Size (MB)',
Round( Sum( data_free ) / 1024 / 1024, 3 ) AS 'Free Space (MB)'
FROM information_schema.tables
GROUP BY table_schema ;
Also the more accurate way to find the file size of the innodb tablespace is as using the INFORMATION_SCHEMA.FILES and not information_schema.tables
select FILE_NAME, TABLESPACE_NAME, TABLE_NAME, ENGINE, INDEX_LENGTH, TOTAL_EXTENTS, EXTENT_SIZE from INFORMATION_SCHEMA.FILES
SELECT FILE_NAME, TABLESPACE_NAME, ROUND((TOTAL_EXTENTS * EXTENT_SIZE) / 1024 / 1024 / 1024, 4) AS SIZE_GB FROM INFORMATION_SCHEMA.FILES order by size_gb desc limit 10;
Try to use the above queries on your reader and writer endpoints and check the results.
Relevant content
- Accepted Answerasked 2 years ago
- asked 10 days ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Hi Raunak, thank you for your time looking into this. I tried running both query you mentioned above on our reader and writer endpoints but it's still showing different results. Not sure why it's showing different results, can't find any issue with same like this, I will still try to dig deeper.