Skip to content

Commit 0e6131a

Browse files
jlsherrillMichaelMraka
authored andcommitted
switch to grouped query for host template floorist query
1 parent 5410d9e commit 0e6131a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

deploy/clowdapp.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,20 @@ objects:
557557
JOIN rh_account a ON a.id = sp.rh_account_id
558558
LEFT JOIN template t on t.id = sp.template_id
559559
ORDER BY a.org_id, sp.inventory_id;
560+
queries:
561+
- prefix: hms_analytics/content-sources/system-template-grouped
562+
chunksize: ${{FLOORIST_HMS_CHUNKSIZE}}
563+
query: >-
564+
SELECT a.org_id,
565+
count(ih.id),
566+
t.uuid::text as template_uuid, t.environment_id, t.name as template_name
567+
FROM system_platform sp
568+
JOIN inventory.hosts ih ON sp.inventory_id = ih.id
569+
JOIN rh_account a ON a.id = sp.rh_account_id
570+
LEFT JOIN template t on t.id = sp.template_id
571+
where sp.last_upload >= date_trunc('month', CURRENT_DATE)
572+
group by a.org_id, template_uuid, t.environment_id, template_name
573+
ORDER BY a.org_id;
560574
561575
562576
- apiVersion: v1

0 commit comments

Comments
 (0)