From a9e2f2e38433beadade09af5923512928ce39de0 Mon Sep 17 00:00:00 2001 From: Daniel Escribano Date: Fri, 27 Dec 2024 14:03:56 +0100 Subject: [PATCH] fix: group by query_id too --- posthog/clickhouse/cancel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/clickhouse/cancel.py b/posthog/clickhouse/cancel.py index 49168915d463b..ddd1514f6429f 100644 --- a/posthog/clickhouse/cancel.py +++ b/posthog/clickhouse/cancel.py @@ -15,7 +15,7 @@ def cancel_query_on_cluster(team_id: int, client_query_id: str) -> None: SELECT hostname() FROM clusterAllReplicas(posthog, system.query_log) WHERE query_id LIKE %(client_query_id)s AND (event_time > (now() - toIntervalDay(1))) - GROUP BY hostname() + GROUP BY hostname(), query_id -- There can be multiple queries with the same client_query_id HAVING (count() = 1) SETTINGS max_execution_time = 5 """,