Version 2 (modified by niles, 11 years ago) (diff) |
---|
Ascertaining how much disk space a series uses
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 :
create temporary table space_used as ( select sum(bytes) as bytes, owning_series from sum_main group by owning_series );
The resulting table looks something like this :
bytes | owning_series ----------------+--------------- 2293889467054 | hmi.m_45s 2551641062389 | hmi.v_45s 2604818885633 | hmi.s_720s 34888439851665 | aia.lev1
The creation of this table can take a while.
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, for data in the hmi series :
select sum(bytes)/1024/1024/1024 as HMI_GB from space_used where owning_series like 'hmi%'; hmi_gb -------------------- 51440.777539771982 (1 row)
And for data in the AIA series :
select sum(bytes)/1024/1024/1024 as AIA_GB from space_used where owning_series like 'aia%'; aia_gb -------------------- 47510.095782309771 (1 row)