This page shows you how to identify and, if necessary, cancel SQL queries that are taking longer than expected to process.
Schema changes are treated differently than other SQL queries. You can use SHOW JOBS to monitor the progress of schema changes and CANCEL JOB to cancel schema changes that are taking longer than expected.
You can also filter for queries that have been running for a certain amount of time. For example, to find queries that have been running for more than 3 hours, you would run the following:
> WITH x AS (SHOW CLUSTER STATEMENTS) SELECT * FROM x WHERE start < (now() - INTERVAL '3 hours');
If a query’s text ends with a trailing ellipsis (…), it has been truncated. To view more of the query text, increase the value of the cluster setting.
After cancelling a long-running query, use the statement to examine it. It’s possible that the query was slow because it performs a full-table scan. In these cases, you can likely improve the query’s performance by .