Remedying Slow Queries¶
This page describes how to troubleshoot the causes of slow queries.
Slow queries may be the result of various factors, including inefficient query practices, suboptimal table designs, or issues with system resources. If you’re experiencing sluggish query performance, it’s essential to diagnose and address the underlying causes promptly.
- Step 1: A single query is slow¶
If a query isn’t performing as you expect, follow the Query best practices section of the Optimization and Best Practices guide.
If all queries are slow, continue to step 2.
- Step 2: Check that all workers are up (web interface)¶
Check the BLUE web interface upper ribbon for inactive Workers.
If not all Workers are up, ask a
clusteradmin
to resume suspended Workers.
If all workers are up, continue to step 3.
- Step 4: Check for sufficient number of Workers(web interface)¶
Run the DESCRIBE POOLS command to see if you should reallocate Workers according to each pool workload.
If you do not have enough Workers, consider resizing your cluster.
If the workload is balanced, continue to step 5.
- Step 5: Check if there are long running statements¶
Identify any currently running statements, using the DESCRIBE SESSION QUERIES utility command.
If there are more statements than available resources, some statements may be in an
In queue
mode.If there is a statement that has been running for too long and is blocking the queue, consider stopping it using the ABORT utility command.
If the statement does not stop correctly, contact BLUE support at blue_support@sqreamtech.com.
If there are no long running statements or this does not help, continue to step 6.
- Step 6: Check if there are active locks¶
Use DESCRIBE LOCKS utility command to list any outstanding locks.
If a statement is locking some objects, consider waiting for that statement to end or stopping it.
If after a statement is completed the locks don’t free up, refer to the Concurrency and Locks guide.
If performance does not improve, contact BLUE support at blue_support@sqreamtech.com.