Authoritative reference for raw metrics emitted by the database Query Profile, grouped by operator.
Use it as a glossary; for troubleshooting guidance jump to query_profile_tuning_recipes.md.
Summary Metrics
Basic information about the query execution:Planner Metrics
It provides a comprehensive overview of the planner. Typically, if the total time spent on the planner is less than 10ms, it is not a cause for concern. In certain scenarios, the planner may require more time:- Complex queries may necessitate additional time for parsing and optimization to ensure an optimal execution plan.
- The presence of numerous materialized views can increase the time required for query rewriting.
- When multiple concurrent queries exhaust system resources and the query queue is utilized, the
Pendingtime may be prolonged. - Queries involving external tables may incur additional time for communication with the external metadata server.
Execution Overview Metrics
High-level execution statistics:Per-Table Scan Stats
APerTableScanStats summary is attached to the merged query profile, breaking down scan
work by table and by backend host. It is built by walking the per-instance profile tree
before the isomorphic merge collapses host-level information, aggregating the RowsRead,
BytesRead, and RawRowsRead counters that scan operators publish on UniqueMetrics
together with the Database and Table info strings. The key is qualified with the
database name so that same-named tables in different databases (for example db1.orders
vs db2.orders) are kept in separate buckets. If the BE does not report a database for a
given scan, the bare table name is used as a fallback. Useful for spotting data skew
across BE nodes and identifying which tables dominate a query’s scan cost.
Structure:
Fragment Metrics
Fragment-level execution details:Pipeline Metrics
Pipeline execution details and relationships:
- DriverTotalTime = ActiveTime + PendingTime + ScheduleTime
- ActiveTime = ∑ OperatorTotalTime + OverheadTime
- PendingTime = InputEmptyTime + OutputFullTime + PreconditionBlockTime + PendingFinishTime
- InputEmptyTime = FirstInputEmptyTime + FollowupInputEmptyTime
Operator Metrics
Scan Operator
OLAP Scan Operator
The OLAP_SCAN Operator is responsible for reading data from native tables.Shared-data vector index loading
Shared-data scans also exposeVectorIndexIOLocalDiskBytes, VectorIndexIOLocalDiskTime, VectorIndexParallelLoads, and VectorIndexStreamedLoads. Local I/O values come from the underlying file system’s local-disk statistics; load-mode counters follow the counting rules described above.
When a shared-data scan prepares a seed iterator to refine physical scan splits, vector index loading in that phase is recorded under SeedVectorIndex* within SeedPrepareTime, separately from the ordinary scan-phase counters. The I/O metrics below cover initial index loading, excluding array allocation, deserialization, and later IVF list reads during search. Local and remote I/O times are summed across streams, so parallel reads can exceed the elapsed time reported by VectorIndexFileRead or SeedVectorIndexFileRead.
Connector Scan Operator
It’s similar to OLAP_SCAN operator but used for scan external tables like Iceberg/Hive/Hudi/Detal.Exchange Operator
Exchange Operator is responsible for transmitting data between BE nodes. There can be several kinds of exchange operations: GATHER/BROADCAST/SHUFFLE. Typical scenarios that can make Exchange Operator the bottleneck of a query:- Broadcast Join: This is a suitable method for a small table. However, in exceptional cases when the optimizer chooses a suboptimal query plan, it can lead to a significant increase in network bandwidth.
- Shuffle Aggregation/Join: Shuffling a large table can result in a significant increase in network bandwidth.
Exchange Sink Operator
Exchange Source Operator
Aggregate Operator
Metrics ListJoin Operator
Metrics ListWindow Function Operator
Sort Operator
Merge Operator
TableFunction Operator
Project Operator
Project Operator is responsible for performingSELECT <expr>. If there’re some expensive expressions in the query, this operator can take significant time.
AI Project Operator
AI Project executes asynchronous model calls. Its source operator exposes the following fixed counters inUniqueMetrics. Each driver reports only its own completed tasks; profile refreshes replace cumulative values rather than adding them again.
All counters, including
AIHttpTime, aggregate by sum across drivers. Concurrent requests can make this cumulative time exceed query wall-clock time. A task publishes its statistics at terminal completion, so ongoing tasks are not included yet.
AI counters opt into saturating Profile summation: totals stop at the signed 64-bit maximum instead of overflowing. This requires all participating BE and FE Profile mergers to support the optional counter strategy. Older nodes ignore the strategy and retain their existing merge behavior during rolling upgrades. Other counters keep their existing aggregation policies.
A token counter of zero with its corresponding usage count of zero means unreported, not zero consumption. A positive usage count does not imply complete provider coverage: missing, invalid, or unparsed response usage is excluded independently for each field. These are observed execution statistics, not token estimates or an exactly-once billing ledger. Query statistics and audit reporting reuse their existing delivery and failure semantics, independently of whether Profile collection is enabled. No prompts, responses, credentials, or model identifiers are added to these counters.
LocalExchange Operator
OlapTableSink Operator
OlapTableSink Operator is responsible for performing theINSERT INTO <table> operation.
Tip
- An excessive difference between the Max and Min values of the
PushChunkNummetric ofOlapTableSinkindicates data skew in the upstream operators, which may lead to a bottleneck in loading performance. RpcClientSideTimeequalsRpcServerSideTimeplus network transmission time plus RPC framework processing time. If there is a significant difference betweenRpcClientSideTimeandRpcServerSideTime, consider enabling compression to reduce transmission time.
Spill Metrics
When a query exceeds its memory budget, the spillable operators write intermediate data to disk or to remote storage. Every one of them publishes the same counter group,SpillStatistics, inside its
own operator profile: the spillable aggregate and distinct operators, the hash join and nested loop
join build and probe operators, and the sort operator.
Which counters are non-zero depends on which of the three writers the operator uses:
- Sorted — the blocking aggregate and blocking
DISTINCToperators, which sort by theGROUP BYexpressions, and the sort operator, which sorts by theORDER BYexpressions. Each mem-table is sorted and written out as one sorted block group; once enough of them accumulate, they are merged back into one. This is the only writer with a compaction stage.SortChunkTimeandMaterializeChunkTimeare non-zero only here, and so areCompactTime,CompactMergeTime,CompactCount,CompactBlockCount,CompactBytesRead, andCompactBytesWritten— and those only when block compaction is enabled, which today means the blocking aggregate operator and the sort operator. - Partitioned — the hash join build and probe operators and the partition-wise aggregate and
DISTINCToperators. Rows are hash-partitioned and each partition is written out on its own; there is no compaction stage. A partition that grows past the mem-table limit is split in two instead, and that work is counted underSplitPartitionTimerather thanFlushTime.ShuffleTime,SplitPartitionTime,PartitionWriterPeakMemoryBytes, and theSkewMemTable*counters are non-zero only here. - Unordered — the nested loop join build and probe operators. Mem-tables are written out as they are, with no sorting, no partitioning, and no compaction.
FlushMemTableTime measures the first write-out and is reported by the sorted and the unordered
writer. The partitioned writer has no such stage and leaves it at zero.
Counter tree
WriteIOTime, ReadIOTime, BytesFlush, BytesRestore, BlockCount, and ReadIOCount are
grouping rows for query spill: the value is always charged to the Local... or Remote... child
that matches where the block lives, and the parent row stays at 0. Read the totals from the
children.
Accepting rows
These counters are charged to the operator’s own thread, so they are part of the operator’s time.Writing data out
These counters are charged to the spill I/O threads. They run asynchronously, so they do not add to the operator’s time directly; they slow the query down when the operator has to wait for a free mem-table.Compaction
Reading data back
Overlapping counters
Several counters cover the same work, so adding them up double-counts:MemTableFinalizeTimecontains theSerializeTimeand write I/O of the mem-table it is writing out. It is a stage boundary, not an extra cost.SerializeTime,WriteIOTime, andBytesFlushcount both the first write-out and the compaction rewrite.CompactBytesWrittenis the compaction share ofBytesFlush.DeserializeTime,ReadIOTime,ReadIOCount, andBytesRestoreare shared by restore and by compaction, which reads its input back through the same path.CompactBytesReadis the compaction share ofBytesRestore; subtract it fromBytesRestoreto get what restore itself read.CompactMergeTimedoes not overlapDeserializeTimeorReadIOTime. The merge only takes chunks that a prefetch has already placed in the input buffer; the read and the deserialization that fill that buffer are charged separately.
How to read these counters
-
Start from
FlushTime. When spilling dominates a query,FlushTimeis usually the largest value in the group, and the upstream operator’s wait time typically tracks it. -
Split
FlushTimeinto its two stages (sorted writer only):FlushTime=FlushMemTableTime+CompactTime.FlushMemTableTimedominates: writing the data out the first time is the cost. CompareSerializeTimeagainstLocalWriteIOTimeandRemoteWriteIOTimeto tell CPU-bound serialization from a slow device, and checkBytesFlushfor how much data is involved. A wide table, or one whose columns are mostly NULL, makes serialization the larger of the two.CompactTimedominates: the query keeps producing enough sorted block groups to hit the merge threshold, and the same data is being rewritten.CompactCountis the number of rounds andCompactBlockCountthe number of block groups they consumed.CompactBytesReadandCompactBytesWrittenagainstBytesRestoreandBytesFlushgive the write amplification compaction adds; when they approach the totals, most of the I/O is rewriting rather than making progress.
-
Look at
CompactMergeTimeinsideCompactTime. It is the merge itself, so its share says where compaction is stuck:- A high share means the merge is CPU-bound. Many sort columns, wide chunks, or many block groups merged at once all push key comparison and chunk assembly up.
- A low share means the merge is waiting on its input or its output. The rest of
CompactTimeis then the read side (ReadIOTime,DeserializeTime) or the write side (SerializeTime,WriteIOTime), and those counters say which.
-
Check for concurrency limits.
PeakFlushIOTaskCountandPeakRestoreIOTaskCountshow how many I/O tasks ever ran at once; a highFlushIOTaskYieldCountmeans flush tasks repeatedly ran out of their time slice and had to be resubmitted. -
Do not add overlapping counters together. See
Overlapping counters before treating the group as a breakdown of
FlushTime.