summaryrefslogtreecommitdiff
path: root/graphs/sql/maas/req05_select.sql
blob: 2a8e816158f047f4619e9a4149e70dbfd5e16e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
SELECT
    name AS zone_name,
    COUNT(DISTINCT data_center_id) AS data_center_count,
    COUNT(DISTINCT sh.id) AS total_servers,
    SUM(core_count) AS total_cores,
    SUM(ram) AS total_ram,
    SUM(storage) AS total_storage
FROM memorin.server_hierarchy AS sh
INNER JOIN memorin.geographic_zones AS z
ON z.id = zone_id
GROUP BY name
ORDER BY data_center_count DESC, total_servers DESC, zone_name