Skip to content

Commit

Permalink
fix(debug): Restore order to CH query debug modal list (#21221)
Browse files Browse the repository at this point in the history
* fix(debug): Restore order to CH query debug modal list

* Fix non-aggregated value usage
  • Loading branch information
Twixes authored Mar 28, 2024
1 parent dea1a23 commit 68795d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ee/api/debug_ch_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def list(self, request):
response = sync_execute(
"""
SELECT
query_id, argMax(query, type), argMax(query_start_time, type), argMax(exception, type),
argMax(query_duration_ms, type), max(type) AS status
query_id,
argMax(query, type) AS query,
argMax(query_start_time, type) AS query_start_time,
argMax(exception, type) AS exception,
argMax(query_duration_ms, type) AS query_duration_ms,
max(type) AS status
FROM (
SELECT
query_id, query, query_start_time, exception, query_duration_ms, toInt8(type) AS type
Expand All @@ -41,10 +45,11 @@ def list(self, request):
query LIKE %(query)s AND
query NOT LIKE %(not_query)s AND
query_start_time > %(start_time)s
ORDER BY query_start_time desc
ORDER BY query_start_time DESC
LIMIT 100
)
GROUP BY query_id""",
GROUP BY query_id
ORDER BY query_start_time DESC""",
{
"query": f"/* user_id:{request.user.pk} %",
"start_time": (now() - relativedelta(minutes=10)).timestamp(),
Expand Down

0 comments on commit 68795d0

Please sign in to comment.