Created
August 29, 2017 15:06
-
-
Save mr-stringer/c8b657e232f8a8cb9b2c8571923b689b to your computer and use it in GitHub Desktop.
A single statement to calculate HANA table data footprint
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 | |
| ROUND(SUM(BYTES)/1024/1024/1024,3) AS DATA_FOOTPRINT_GiB | |
| FROM ( | |
| SELECT | |
| ( | |
| SUM(MEMORY_SIZE_IN_TOTAL) + | |
| SUM(MEMORY_SIZE_IN_DELTA) + | |
| SUM( | |
| CASE | |
| WHEN LOADED = 'FULL' THEN '0' | |
| WHEN ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL - MEMORY_SIZE_IN_TOTAL < 0 THEN '0' | |
| ELSE ESTIMATED_MAX_MEMORY_SIZE_IN_TOTAL - MEMORY_SIZE_IN_TOTAL END) | |
| ) AS BYTES | |
| FROM M_CS_TABLES | |
| UNION ALL | |
| SELECT | |
| SUM(PAGE_SIZE * USED_BLOCK_COUNT) AS BYTES | |
| FROM | |
| M_DATA_VOLUME_PAGE_STATISTICS | |
| WHERE | |
| PAGE_SIZECLASS = '16k-RowStore' | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment