| 1 | |
| 2 | Ascertaining how much disk space a series uses |
| 3 | |
| 4 | The first thing to do is to go into the SUMS database and build a temporary table (lasts only for the current session) with storage information : |
| 5 | |
| 6 | create temporary table space_used as ( select sum(bytes) as bytes, owning_series from sum_main group by owning_series ); |
| 7 | |
| 8 | The resulting table looks something like this : |
| 9 | |
| 10 | bytes | owning_series |
| 11 | ----------------+--------------- |
| 12 | 2293889467054 | hmi.m_45s |
| 13 | 2551641062389 | hmi.v_45s |
| 14 | 2604818885633 | hmi.s_720s |
| 15 | 34888439851665 | aia.lev1 |
| 16 | |
| 17 | The creation of this table can take a while. |
| 18 | |
| 19 | Then we need to do a sum through that table of storage for series name(s) that match what we want (and convert to GB) - for instance : |
| 20 | |
| 21 | select sum(bytes)/1024/1024/1024 as HMI_GB from space_used where owning_series like 'hmi%'; |
| 22 | hmi_gb |
| 23 | -------------------- |
| 24 | 51440.777539771982 |
| 25 | (1 row) |
| 26 | |
| 27 | |
| 28 | select sum(bytes)/1024/1024/1024 as AIA_GB from space_used where owning_series like 'aia%'; |
| 29 | aia_gb |
| 30 | -------------------- |
| 31 | 47510.095782309771 |
| 32 | (1 row) |
| 33 | |
| 34 | |