Trend

[SingleStore Guide #2] Slow Query? Find the Cause Before You Tune

2026.11.24 · Jinseok Lee

Read the original in Korean
[SingleStore Guide #2] Slow Query? Find the Cause Before You Tune

[SingleStore Guide #2] Slow Query? Find the Cause Before You Tune

Author
Jinseok Lee
Date
Nov 24, 2026
Description
When a SingleStore query slows down with no SQL change, find the cause first: queries, waits, node resources, partitions, following the official 8 steps.
Featured
Featured
KO slug
singlestore-slow-query-troubleshooting
Status
Published
Tag
Trend
Translation
AI draft
Translated from the Korean original. Some screenshots show the original Korean interface.

From SQL to the cluster: the order for tracking down a slowdown

If query response times in SingleStore are longer than usual even though nobody changed the SQL, where should you look first? The same SQL statement can take longer when it has more data to read or when its execution plan changes. Response times also grow when requests pile up in the same time window and queries wait to run. Before you rewrite the SQL, find out where the extra time was spent.
SingleStore is a distributed database in which multiple nodes share data storage and query processing. For a query that spans several leaves, an aggregator receives the query and sends work to the leaf nodes that are needed. Each leaf reads and processes its data, and the aggregator collects the results and returns them. If even one leaf is slow, the user has to wait for its result.
Part 1, Transactions and Analytics: Why Handle Both in One DB?, looked at a case where data concentrated in one partition raised the load on a single leaf while the cluster average barely showed the difference. To confirm that data skew caused an actual slowdown, first check whether the leaf that processed the query is the same leaf that was under high load.
 
💡
Terms used in this post
A node is one SingleStore server process. One physical server can run several nodes. A partition is the unit by which data is split, stored, and processed across leaves.
 
Diagnosis starts with finding the time window in which responses were slow. If the slowdown is still happening, you can look at running queries and wait states right away. If responses are already back to normal, you have to compare the query history and per-node metrics collected at that time.
The order below follows the preliminary checks and 8 steps in the official troubleshooting guide for SingleStore 9.0 Self-Managed. Which step deserves a closer look depends on the symptom. If you see queries waiting on a lock, start by finding the blocking session. If one leaf stands out for its load, look at the data distribution of the partitions on that leaf.
 
 

1. Before you diagnose: check cluster settings and node status

Before analyzing queries, check that the operating system and node settings match the recommended values and that no node is offline. Use sdb-report, an administration tool included in SingleStore Toolbox. sdb-report collect gathers configuration and status information from hosts and nodes into a file. Run sdb-report check --report-path <report file> against that file, and items that differ from the recommended settings are marked WARN or FAIL.
In the example in the official documentation, an item with Linux Transparent Huge Pages (THP) enabled and an offline leaf node are marked FAIL. Find the cause of each FAIL item and fix it before moving to the next step. For WARN items, write them down so you can compare that node's settings with the resource metrics you check later.
 
💡
Before you use Studio
SingleStore Studio is an administration tool that lets you run SQL in a web browser and see node status and running queries in a cluster. The checks in each step below are described using the Studio screens from the official SingleStore troubleshooting guide.
SingleStore recommends its cluster monitoring solution for Self-Managed environments, and Studio is not compatible with the SingleStore Kubernetes Operator. For real checks, use the monitoring dashboards that fit your environment together with the SQL views and commands introduced in each step.
 
 

2. Check the queries (Steps 1-2): find the SQL to analyze and read its execution plan

Once the basic state of the cluster is checked, look at the queries from the slow time window. First find the SQL that ran long or used a lot of resources. Then read the execution plan to see which operators processed how much data and how long they took.
 

Step 1. Find queries with long run times or high resource usage

Pick the SQL to analyze from the execution statistics of the time window in which responses were slow. If cluster monitoring is configured, start by opening the workload history for that window.
If there is no stored history and the slowdown is ongoing or reproducible, click Begin Profiling in Studio's Workload Monitoring to record current activity. Studio uses the statistics at the start and end of the recording to show the activity in that interval. If you start recording after the problem is over, this screen can hardly show the earlier slowdown.
When you find SQL with a large Elapsed Time, look at its Run Count as well. Even a short query adds up to a long cumulative time if it runs often. To tell whether a single execution got slower, the history of completed queries is more accurate, because Studio's totals also include work that is still running.
If the run count is higher than usual, first check service request volume and batch schedules for the same window. If request volume is about normal and only the calls went up, suspect a code path in the application that repeats the same SQL. If the calls are legitimate and the query still uses a lot of resources, its execution plan is worth examining.
Once you have chosen a query to analyze, write down its activity_name. You use this value in Step 2 to find the SQL statement. The Nodes tab also shows which nodes the query ran on.
If no long-running or resource-heavy query shows up, first confirm that the recording actually covers the slow time window. If the record for that window still has no clear candidate, move on to Step 3 and check whether the query waited in a queue to run or waited for a lock held by another transaction to be released.
 

Step 2. Check the data volume processed and the run time in the execution plan

Use the activity_name you noted in Step 1 to find the SQL statement in MV_QUERIES. Reading the statement tells you roughly how much data the query should have to read or move. For example, a query that aggregates all sales naturally reads many rows. If a query that only needs last month's sales read several years of data, you have a reason to look at the date condition and the sort key.
EXPLAIN shows the plan that would be chosen if the query were optimized again now. At the time of the slowdown, a different cached plan may have been used. To see how many rows were actually processed and which operators took the time, measure with PROFILE and view the result with SHOW PROFILE. If an execution record from the time of the slowdown remains, compare it with the new measurement.
PROFILE actually executes the target SQL. If the query changes data or puts heavy load on the system, check the plan with EXPLAIN first. To measure real performance, it is better to use a separate test environment whose data volume and distribution are close to production.
For the operators and warnings that appear often in profiling results, checking the items below together makes the judgment easier.
 
Execution plan / warning
Meaning
What to check with it
Repartitioning
Operators that redistribute data and move it between nodes for joins and aggregations
Amount of data moved and time taken; how the shard key relates to the join and aggregation keys
TableScan / ColumnStoreScan
Operators that read rowstore and columnstore data, respectively
Rows processed and time taken; whether filters, indexes, or the sort key can narrow the range that is read
Execution plan warnings
Warnings left by the optimizer (see PLAN_WARNINGS in MV_PLANCACHE)
The warning text, and the actual volume processed and time taken by the related operators
 
If estimated and actual row counts differ widely, first ask whether the statistics reflect the data distribution after recent loads or deletes. If a change in statistics affected the plan, consider running ANALYZE on the table. Compare performance before and after the change under similar conditions: the same query range and a similar load from concurrent work.
 
 

3. Check the waits (Step 3): find out why the query response was late

A query response can be late even when reading and processing the data takes little time. If a query sits in a queue or waits for another transaction's lock to be released, the response time grows by that much.
 

Step 3. Did it wait in a queue, or wait for a lock to be released?

Studio's Active Queries screen shows a Status and a Time for each query. For a query that has been listed for a long time, first tell whether it is queued, executing, or waiting on another session's lock.
  • Waiting for its turn to run: Querying MV_PROCESSLIST shows queries in the queued state. Also check whether service requests or batch jobs increased at the same time, and whether a query that is running longer than usual is holding resources.
  • Waiting on a lock: MV_BLOCKED_QUERIES lists the waiting session (ID) and the session holding the lock (BLOCKING_ID) along with node information. The description of the blocking session sometimes shows open idle transaction. A session that is not running any SQL right now can still hold a lock if it never finished an earlier transaction.
If you find a session with an unfinished transaction like this, first check whether the owning application is missing a commit or rollback. KILL QUERY stops the running statement but keeps the connection. If you have to close the connection itself, first consider how rolling back the uncommitted changes will affect the service.
If a waiting query failed, the error message is the first clue. For a timeout error, look at the QUERY_TIMEOUT setting of the resource pool applied to that query. This limit also counts the time spent waiting in the queue, so a query can be canceled even when its run time is short.
 
 

4. Check the cluster (Steps 4-8): resources, operational activities, nodes and partitions

After the execution plan and the waits, widen the scope to the nodes that processed the query. Whether a node ran short of resources, another operational activity overlapped, or data was concentrated on one leaf: once that is known, it explains the background of what you saw in the query analysis.
 

Step 4. Compare resource usage by node

Look at CPU, memory, and disk usage during the slow window node by node. The official guide says to view overall usage on the Studio dashboard and then sort the Hosts and Nodes pages by CPU, memory, and disk usage.
Disk Usage on the Nodes screen shows how much disk space is in use. To see whether disk reads and writes spiked when the query slowed down, you need I/O throughput for the same window separately.
If the load was high on only one leaf, start with the queries that leaf processed and the amount of data it holds. If the load rose on several nodes together, suspect an increase in requests or data loading at that time.
Once you have the node and time window where load increased, go back to Step 1 and narrow the query statistics to the same interval. SQL whose resource usage grew in that interval is a candidate cause. If some usage is left unexplained by the query statistics, or resources look fine, move on to the operational activities in Step 5.
 

Step 5. Check operational activities that ran in the same time window

Backups, schema changes, and partition rebalancing use the same resources as queries. If the slowdown is ongoing, look in MV_PROCESSLIST on the master aggregator for work running alongside. Start and end times of finished work remain in backup and batch run records and in monitoring history.
If schedules overlapped, look at both the interval where the query slowed down and the interval where it sped up again. For example, if disk reads rose during a backup and query times returned to normal after the backup finished, that is grounds to investigate the I/O load in that interval.
 

Step 6. Check node and partition health

A leaf can be online while partitions on it are detached. Check leaf state under Hosts and Nodes in Studio, then open the Partitions tab of the target database and confirm that the partitions are online and properly attached.
If you find an offline leaf, first tell whether it was a planned stop or a process failure or network problem. It is safer to decide whether to restart the node after checking the host logs and replication status.
 

Step 7. Check partition count and data distribution

If one leaf carried a notably high load in Step 4, look at the partitions on that leaf. SHOW PARTITIONS shows which leaf each master partition is placed on. Then compare the row counts per partition for the target table in TABLE_STATISTICS. Even when leaves hold a similar number of partitions, rows concentrated in one partition can concentrate work on that leaf.
Does the difference in row counts between partitions explain this slowdown? The test is whether the slow query actually read that partition and whether that leaf's load was also high at the same time. If both hold and the skew keeps recurring, look at the value distribution of the shard key, which decides how data is split. Moving a partition to another leaf does not change the rows concentrated inside it.
If the number of partitions differs widely between leaves, review the rebalance plan. Decide on the actual move or replica recovery after checking node and replica state and the service load, because write requests can briefly wait or be interrupted while a master partition moves.
 

Step 8. Check configuration change history and error and warning logs

If the earlier steps do not explain the cause, find out what changed around the time the slowdown began. An operating system, application, or cluster setting that changed just before the slowdown is the first suspect. Errors and warnings logged in the same interval are clues too.
In Studio's Events, narrow down to the slow window and review the errors and warnings. For the same interval, compare tracelogs/memsql.log on the master aggregator, the aggregator that received the request, and the leaf where load concentrated to trace which node showed the problem first. If you suspect a node failure or disk error, read that host's system logs as well. When lining up records from several hosts, check time zones and clock differences first.
 
 

5. Records you need for after-the-fact analysis

If queries were slow in the morning and back to normal in the afternoon, the afternoon's query list and CPU usage can hardly explain the morning. Which queries ran for how long, and what the load on those nodes was then: compare records from the same time window with each other.
In a Self-Managed environment, cluster monitoring can collect per-node resource metrics and workload history. If you also need execution records for individual queries, set the run-time threshold above which queries are kept when you configure event tracing for Query History.
If a lock wait occurs, save the output of MV_BLOCKED_QUERIES before the wait clears. Query execution history alone can hardly tell you which session held the lock and which one waited at that time.
With the query history and the node metrics from the time of the slowdown side by side, you can decide whether to tune the SQL or to look first at the transaction holding a lock or the leaf under concentrated load.
 
 

6. Monitoring a SingleStore cluster with exemONE

After you find the slow query, the next question is "What state was the leaf that processed this query in at the time?" EXEM's exemONE supports SingleStore 8.9 and later, and its cluster view shows the layout of aggregators and leaves together with rankings of disk and memory usage by node.
For example, if a node is using an unusually large amount of memory when queries slow down, start by checking that node's role on the cluster map. If it is a leaf, check whether the slow query ran on that leaf and whether its memory usage is normally high too. This is how the usage rankings help you pick the next node to investigate.
The SingleStore cluster view in exemONE. The cluster map is on the left, and the rank panel on the right shows disk and memory usage by node.
The SingleStore cluster view in exemONE. The cluster map is on the left, and the rank panel on the right shows disk and memory usage by node.
Kbank, which runs heterogeneous databases side by side, analyzes Oracle with MaxGauge and SingleStore, Aurora, Redshift, PostgreSQL, and others with exemONE. When a performance problem occurs, the team first finds the time window where the overall trend looks abnormal, then narrows that interval down to the second.
The starting point is the same for SingleStore. Find the time window where responses slowed down, then look at the query execution records together with the state of the leaf that processed the query, and you can decide whether to fix the SQL or look further into locks or data distribution.
 
Running SingleStore alongside other databases? Start monitoring heterogeneous databases with exemONE 👉🏻
 
 
Sources
 
 

 
 

 
 
Related articles