Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@t3dcachedb ~]# cat txt.SQL
- WITH
- ethz_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_bphys_GB FROM t_inodes WHERE igid=530 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_ecal AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_ecal_GB FROM t_inodes WHERE igid=529 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_ewk AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_ewk_GB FROM t_inodes WHERE igid=531 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_higgs AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_higgs_GB FROM t_inodes WHERE igid=532 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_susy AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_susy_GB FROM t_inodes WHERE igid=533 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- psi_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS psi_bphys_GB FROM t_inodes WHERE igid=534 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- psi_pixel AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS psi_pixel_GB FROM t_inodes WHERE igid=535 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_bphys_GB FROM t_inodes WHERE igid=536 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_higgs AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_higgs_GB FROM t_inodes WHERE igid=537 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_pixel AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_pixel_GB FROM t_inodes WHERE igid=538 GROUP BY to_char(icrtime, 'yyyy-mm') )
- SELECT * FROM
- ethz_bphys
- NATURAL FULL OUTER JOIN ethz_ecal
- NATURAL FULL OUTER JOIN ethz_ewk
- NATURAL FULL OUTER JOIN ethz_higgs
- NATURAL FULL OUTER JOIN ethz_susy
- NATURAL FULL OUTER JOIN psi_bphys
- NATURAL FULL OUTER JOIN psi_pixel
- NATURAL FULL OUTER JOIN uniz_bphys
- NATURAL FULL OUTER JOIN uniz_higgs
- NATURAL FULL OUTER JOIN uniz_pixel
- ORDER BY period ASC ;
- [root@t3dcachedb ~]# psql -U nagios -d chimera -f ./txt.SQL
- psql:./txt.SQL:29: LOG: duration: 13013.731 ms statement: WITH
- ethz_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_bphys_GB FROM t_inodes WHERE igid=530 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_ecal AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_ecal_GB FROM t_inodes WHERE igid=529 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_ewk AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_ewk_GB FROM t_inodes WHERE igid=531 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_higgs AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_higgs_GB FROM t_inodes WHERE igid=532 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- ethz_susy AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS ethz_susy_GB FROM t_inodes WHERE igid=533 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- psi_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS psi_bphys_GB FROM t_inodes WHERE igid=534 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- psi_pixel AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS psi_pixel_GB FROM t_inodes WHERE igid=535 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_bphys AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_bphys_GB FROM t_inodes WHERE igid=536 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_higgs AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_higgs_GB FROM t_inodes WHERE igid=537 GROUP BY to_char(icrtime, 'yyyy-mm') ),
- uniz_pixel AS ( SELECT to_char(icrtime, 'yyyy-mm') AS period, trunc(SUM(isize)/1000/1000/1000) AS uniz_pixel_GB FROM t_inodes WHERE igid=538 GROUP BY to_char(icrtime, 'yyyy-mm') )
- SELECT * FROM
- ethz_bphys
- NATURAL FULL OUTER JOIN ethz_ecal
- NATURAL FULL OUTER JOIN ethz_ewk
- NATURAL FULL OUTER JOIN ethz_higgs
- NATURAL FULL OUTER JOIN ethz_susy
- NATURAL FULL OUTER JOIN psi_bphys
- NATURAL FULL OUTER JOIN psi_pixel
- NATURAL FULL OUTER JOIN uniz_bphys
- NATURAL FULL OUTER JOIN uniz_higgs
- NATURAL FULL OUTER JOIN uniz_pixel
- ORDER BY period ASC ;
- period | ethz_bphys_gb | ethz_ecal_gb | ethz_ewk_gb | ethz_higgs_gb | ethz_susy_gb | psi_bphys_gb | psi_pixel_gb | uniz_bphys_gb | uniz_higgs_gb | uniz_pixel_gb
- ---------+---------------+--------------+-------------+---------------+--------------+--------------+--------------+---------------+---------------+---------------
- 1970-01 | | 0 | | | 0 | | | | |
- 2008-11 | | | | 4 | | | | | |
- 2009-04 | | | | 1232 | | | | | |
- 2009-05 | | | | 0 | | | | | |
- 2009-06 | | | | 0 | | | | | |
- 2009-07 | | | | 0 | | 10 | | | |
- 2009-08 | | | | | | 3 | | | |
- 2009-09 | 2 | | | | | | | | |
- 2009-10 | 947 | | | 0 | | | | | |
- 2009-11 | 338 | | | | | | | | |
- 2009-12 | 1254 | | | | | | | | |
- 2010-01 | 264 | | | | | | | | |
- 2010-03 | 2 | | | | 1 | | | | |
- 2010-04 | 0 | | | | 6 | | | | |
- 2010-05 | 0 | | | | 44 | 0 | | | |
- 2010-06 | 0 | | | | | 52 | | | |
- 2010-07 | | | | | 204 | 1 | | | |
- 2010-08 | 240 | | | | 0 | 29 | | 57 | |
- 2010-09 | 0 | | | | | | | 0 | |
- 2010-10 | 11 | | | | 44 | 9 | | 4136 | |
- 2010-11 | 0 | | | | 0 | | | 6293 | |
- 2011-01 | 0 | | | | | 11 | | 327 | |
- 2011-02 | | | | | 576 | 239 | | 233 | |
- 2011-03 | | | | | 109 | 233 | | 347 | |
- 2011-04 | | | | 0 | 1 | 155 | | 194 | |
- 2011-05 | | 0 | | 70 | 62 | | | 133 | |
- 2011-06 | 78 | | | 0 | 14 | 16 | | 204 | |
- 2011-07 | 319 | | 0 | 186 | 7 | 103 | | 1345 | |
- 2011-08 | 0 | | | 0 | | | | 874 | |
- 2011-09 | | | | 5 | 6 | 302 | | 614 | |
- 2011-10 | | 0 | | 19 | 31 | 2757 | | 414 | 0 |
- 2011-11 | | | | | 58 | 1843 | | 1104 | |
- 2011-12 | | | | | 81 | 168 | | 709 | |
- 2012-01 | | | | | 773 | 44 | | 5 | 0 |
- 2012-02 | 79 | | | | 303 | 316 | | 9 | |
- 2012-03 | | | | | 149 | 2888 | | 44 | |
- 2012-04 | | | 0 | 0 | 60 | 1524 | | 68 | |
- 2012-05 | | | | | 439 | 6 | 0 | 575 | |
- 2012-06 | | 123 | | 28 | 1467 | 0 | 0 | 276 | |
- 2012-07 | | 339 | 0 | | 108 | 187 | 0 | | | 0
- 2012-08 | | 293 | | | 735 | 5 | | 243 | |
- 2012-09 | | 13 | 2 | | 1036 | 967 | 0 | 0 | |
- 2012-10 | | 63 | 250 | | 2643 | 426 | | | |
- 2012-11 | | 379 | 163 | 101 | 256 | 0 | | | |
- 2012-12 | | 68 | | 1 | 1532 | 704 | | | |
- 2013-01 | | 6595 | 5 | 21 | 1874 | | | 67 | |
- 2013-02 | | 104 | | 2211 | 28480 | 385 | | | 0 |
- 2013-03 | | 4302 | 0 | 454 | 21008 | | 0 | 351 | |
- 2013-04 | | | | 13 | 13129 | 0 | | | 0 | 0
- 2013-05 | | 0 | 139 | 47 | 9429 | 6 | | | 0 | 1110
- 2013-06 | | 15 | 1021 | | 9687 | 0 | | | 3 | 3150
- 2013-07 | | 644 | 537 | 1 | 4756 | 2 | | | |
- 2013-08 | | 963 | 98 | 18 | 1795 | 258 | | | 0 | 6051
- 2013-09 | | 1117 | 2020 | 6 | 551 | | 32 | | 0 | 4958
- 2013-10 | | 407 | 110 | | 3076 | 0 | | | 2 | 498
- 2013-11 | 0 | 3514 | 97 | 201 | 14376 | 0 | 3 | 0 | 0 | 2461
- 2013-12 | | 3316 | 2 | 2 | 1256 | 0 | | | 0 | 2511
- 2014-01 | | 102 | | 30 | 2240 | | | | 19840 |
- 2014-02 | | 593 | 62 | 15 | 203 | 0 | | | 247 | 1325
- 2014-03 | | 71 | 13 | 897 | 272 | | | | 9427 | 2328
- 2014-04 | | 22 | | 330 | 750 | | 1 | | 28535 | 2323
- 2014-05 | | 202 | 0 | 24 | 8685 | 1726 | 2 | | 24055 | 3398
- 2014-06 | | 190 | 62 | 62 | 510 | | 1 | | 6665 | 2368
- 2014-07 | | 4454 | | 325 | 122 | | | | 36475 | 50
- 2014-08 | | 15 | 0 | 193 | 178 | | | | 5860 | 146
- 2014-09 | | 2 | 3 | 74 | 253 | | | | 284 |
- 2014-10 | | 3353 | 0 | 52 | 672 | 3920 | | | 1766 |
- 2014-11 | | 1158 | 4 | 27 | 1306 | 565 | 0 | | 643 |
- 2014-12 | | 365 | 293 | 107 | 1226 | 338 | 0 | | 54 |
- 2015-01 | | 1920 | | 137 | 602 | | 4 | | 783 | 1752
- 2015-02 | | 1486 | | 1 | 1334 | 0 | 4 | | 4737 | 7
- 2015-03 | | 1535 | | 85 | 2675 | 26869 | | | 12382 |
- 2015-04 | | | | 1 | 1687 | 15314 | | | 6448 |
- 2015-05 | | | | 0 | 1 | | | | 346 |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement