|
1 | 1 | SELECT
|
| 2 | + row_number() OVER () AS id, -- exclude schema to anonymize data |
2 | 3 | to_char(DATE_TRUNC('month', date), 'YYYY-MM') AS month,
|
3 |
| - SUM(cluster_count) AS total_cluster_count, |
4 |
| - SUM(node_count) AS total_node_count, |
5 |
| - SUM(infra_node_count) AS total_infra_node_count, |
6 |
| - SUM(control_plane_node_count) AS total_control_plane_node_count, |
7 |
| - SUM(worker_node_count) AS total_worker_node_count, |
8 |
| - SUM(infra_node_cpu_cores) AS total_infra_node_cpu_cores, |
9 |
| - SUM(control_plane_node_cpu_cores) AS total_control_plane_node_cpu_cores, |
10 |
| - SUM(worker_node_cpu_cores) AS total_worker_node_cpu_cores, |
11 |
| - SUM(infra_node_mem_gb) AS total_infra_node_mem_gb, |
12 |
| - SUM(control_plane_node_mem_gb) AS total_control_plane_node_mem_gb, |
13 |
| - SUM(worker_node_mem_gb) AS total_worker_node_mem_gb, |
14 |
| - SUM(pvc_count) AS total_pvc_count, |
15 |
| - SUM(cluster_capacity_cores) AS total_cluster_capacity_cores, |
| 4 | + MAX(cluster_count) AS total_cluster_count, |
| 5 | + MAX(node_count) AS total_node_count, |
| 6 | + MAX(infra_node_count) AS total_infra_node_count, |
| 7 | + MAX(control_plane_node_count) AS total_control_plane_node_count, |
| 8 | + MAX(worker_node_count) AS total_worker_node_count, |
| 9 | + MAX(infra_node_cpu_cores) AS total_infra_node_cpu_cores, |
| 10 | + MAX(control_plane_node_cpu_cores) AS total_control_plane_node_cpu_cores, |
| 11 | + MAX(worker_node_cpu_cores) AS total_worker_node_cpu_cores, |
| 12 | + MAX(infra_node_mem_gb) AS total_infra_node_mem_gb, |
| 13 | + MAX(control_plane_node_mem_gb) AS total_control_plane_node_mem_gb, |
| 14 | + MAX(worker_node_mem_gb) AS total_worker_node_mem_gb, |
| 15 | + MAX(pvc_count) AS total_pvc_count, |
| 16 | + MAX(cluster_capacity_cores) AS total_cluster_capacity_cores, |
16 | 17 | SUM(cluster_capacity_core_hours) AS total_cluster_capacity_core_hours,
|
17 |
| - SUM(cluster_capacity_memory_gb) AS total_cluster_capacity_memory_gb, |
| 18 | + MAX(cluster_capacity_memory_gb) AS total_cluster_capacity_memory_gb, |
18 | 19 | SUM(cluster_capacity_memory_gb_hours) AS total_cluster_capacity_memory_gb_hours,
|
19 |
| - SUM(volume_request_gb) AS total_volume_request_gb, |
| 20 | + MAX(volume_request_gb) AS total_volume_request_gb, |
20 | 21 | SUM(volume_request_gb_mo) AS total_volume_request_gb_mo,
|
21 |
| - SUM(pvc_capacity_gb) AS total_pvc_capacity_gb, |
| 22 | + MAX(pvc_capacity_gb) AS total_pvc_capacity_gb, |
22 | 23 | SUM(pvc_capacity_gb_mo) AS total_pvc_capacity_gb_mo
|
23 | 24 | FROM __cust_openshift_infra_report
|
24 |
| -GROUP BY DATE_TRUNC('month', date) |
25 |
| -ORDER BY DATE_TRUNC('month', date) |
| 25 | +GROUP BY schema, DATE_TRUNC('month', date) |
| 26 | +ORDER BY schema, DATE_TRUNC('month', date) |
26 | 27 | ;
|
0 commit comments