Changes between Version 1 and Version 2 of drmsAscertainSpace
- Timestamp:
- 03/25/14 12:49:01 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
drmsAscertainSpace
v1 v2 1 1 2 Ascertaining how much disk space a series uses 2 = Ascertaining how much disk space a series uses = 3 3 4 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 5 6 {{{ 6 7 create temporary table space_used as ( select sum(bytes) as bytes, owning_series from sum_main group by owning_series ); 8 }}} 7 9 8 10 The resulting table looks something like this : 9 11 12 {{{ 10 13 bytes | owning_series 11 14 ----------------+--------------- … … 14 17 2604818885633 | hmi.s_720s 15 18 34888439851665 | aia.lev1 19 }}} 16 20 17 21 The creation of this table can take a while. 18 22 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 :23 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 : 20 24 25 {{{ 21 26 select sum(bytes)/1024/1024/1024 as HMI_GB from space_used where owning_series like 'hmi%'; 22 27 hmi_gb … … 24 29 51440.777539771982 25 30 (1 row) 31 }}} 26 32 33 And for data in the AIA series : 27 34 35 {{{ 28 36 select sum(bytes)/1024/1024/1024 as AIA_GB from space_used where owning_series like 'aia%'; 29 37 aia_gb … … 31 39 47510.095782309771 32 40 (1 row) 41 }}} 33 42 34