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)
  1. Check the BLUE web interface upper ribbon for inactive Workers.

  2. 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)
  1. Run the DESCRIBE POOLS command to see if you should reallocate Workers according to each pool workload.

  2. 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
  1. 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.

  2. 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
  1. Use DESCRIBE LOCKS utility command to list any outstanding locks.

  2. If a statement is locking some objects, consider waiting for that statement to end or stopping it.

  3. 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.