Skip to content

Commit

Permalink
fix: group by query_id too
Browse files Browse the repository at this point in the history
  • Loading branch information
Daesgar committed Dec 27, 2024
1 parent 854b354 commit a9e2f2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion posthog/clickhouse/cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
""",
Expand Down

0 comments on commit a9e2f2e

Please sign in to comment.