Skip to content

Commit

Permalink
ref(admin): lw delete related system queries
Browse files Browse the repository at this point in the history
  • Loading branch information
MeredithAnya committed Dec 17, 2024
1 parent 11b24ee commit e9ac22d
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions snuba/admin/clickhouse/predefined_system_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,35 @@ class CurrentMerges(SystemQuery):


class CurrentMutations(SystemQuery):
"""Currently executing merges"""
"""Currently executing mutations"""

sql = """
SELECT
command
command,
parts_to_do_names,
parts_to_do
FROM system.mutations
WHERE is_done = 0
"""


class Mutations(SystemQuery):
"""Both current and past mutations"""

sql = """
SELECT
table,
mutation_id,
command,
create_time,
parts_to_do,
is_done,
latest_fail_time,
latest_fail_reason
FROM system.mutations
"""


class CreateTableQuery(SystemQuery):
"""Show the current state of the schema by looking at the create_table_query"""

Expand Down Expand Up @@ -252,3 +271,21 @@ class AsyncInsertFlushErrors(SystemQuery):
ORDER BY
flush DESC
"""


class DistributedDDLQueue(SystemQuery):
"""
Queries executed with ON CLUSTER parameter, most relevant
to lightweight delete queries.
"""

sql = """
SELECT
initiator_host,
host,
cluster,
query,
query_create_time,
query_duration_ms
FROM system.distributed_ddl_queue
"""

0 comments on commit e9ac22d

Please sign in to comment.