Troubleshooting commands

A query can be slow because of many reasons. These include - having too many partitions, distribution of partition size, partition not merged, and the background tasks of the table.

In this article, we will show some commands that can be used for troubleshooting.

SHOW PARTS_INFO

Display information about the partition distribution of a table.

Syntax

SHOW PARTS_INFO FOR <dbName>.<tableName>;

Example

SHOW PARTS_INFO FOR `sample_data`.`sample_data_cell_tower`;

Output

ColumnDescription
partitionThe partition, which is distributed based on the partition key
first_partitionThe value of the first partition column
total_parts_numberThe total number of parts within the partition
total_parts_sizeThe total size of the partition (in bytes)
total_rows_countThe total number of rows of the partition

SHOW PARTS_STATUS

Display the status of a running manipulation task that involves partitioned tables.

Syntax

SHOW PARTS_STATUS FOR <dbName>.<tableName>;

Output

ColumnDescription
typeThe type of manipulation task e.g. Mutate, Merge, Clustering
elapsedThe elapsed time in seconds since the time the manipulation task is created
progressThe progress of manipulation task as a percentage
num_partsThe total number of source partitions that were processed by manipulation task
result_part_namesThe names of the partitions that contain the result of the manipulation task
num_result_partsThe number of partitions that contain the result of the manipulation task
rows_readThe total number of rows that were read by the manipulation task
rows_writtenThe total number of rows that were written by the manipulation task
columns_writtenThe total number of columns that were written by the manipulation task
memory usageThe total amount of memory that was used by the manipulation task

SHOW BACKGROUND_TASKS

Display thread information responsible for the background tasks and the running status of the threads.

Syntax

SHOW BACKGROUND_TASKS FOR <dbName>.<tableName>;

Output

ColumnDescription
typeThe type of background task that is running e.g. PartGCThread, MergeMutateThread, ClusteringThread
statusThe current status of the background task e.g. Running, Paused, Completed
startup_timeThe time at which the background task began
last_wakeup_intervalThe interval between the last two times the task woke up to work
last_wakeup_timeThe time at which the task last woke up to work
num_wakeupThe number of times the task has woken up to work