Skip to main content
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:
  1. Complex queries may necessitate additional time for parsing and optimization to ensure an optimal execution plan.
  2. The presence of numerous materialized views can increase the time required for query rewriting.
  3. When multiple concurrent queries exhaust system resources and the query queue is utilized, the Pending time may be prolonged.
  4. Queries involving external tables may incur additional time for communication with the external metadata server.
Example:

Execution Overview Metrics

High-level execution statistics:

Per-Table Scan Stats

A PerTableScanStats 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: profile_pipeline_time_relationship Key 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 expose VectorIndexIOLocalDiskBytes, 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:
  1. 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.
  2. 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 List

Join Operator

Metrics List

Window Function Operator

Sort Operator

Merge Operator

TableFunction Operator

Project Operator

Project Operator is responsible for performing SELECT <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 in UniqueMetrics. 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 the INSERT INTO <table> operation. Tip
  • An excessive difference between the Max and Min values of the PushChunkNum metric of OlapTableSink indicates data skew in the upstream operators, which may lead to a bottleneck in loading performance.
  • RpcClientSideTime equals RpcServerSideTime plus network transmission time plus RPC framework processing time. If there is a significant difference between RpcClientSideTime and RpcServerSideTime, 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 DISTINCT operators, which sort by the GROUP BY expressions, and the sort operator, which sorts by the ORDER BY expressions. 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. SortChunkTime and MaterializeChunkTime are non-zero only here, and so are CompactTime, CompactMergeTime, CompactCount, CompactBlockCount, CompactBytesRead, and CompactBytesWritten — 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 DISTINCT operators. 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 under SplitPartitionTime rather than FlushTime. ShuffleTime, SplitPartitionTime, PartitionWriterPeakMemoryBytes, and the SkewMemTable* 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

Nesting in this tree means “is part of” only where the description says so. Several counters are siblings in the tree but still overlap in time, because the same work is charged to more than one of them. See Overlapping counters. Note 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:
  • MemTableFinalizeTime contains the SerializeTime and write I/O of the mem-table it is writing out. It is a stage boundary, not an extra cost.
  • SerializeTime, WriteIOTime, and BytesFlush count both the first write-out and the compaction rewrite. CompactBytesWritten is the compaction share of BytesFlush.
  • DeserializeTime, ReadIOTime, ReadIOCount, and BytesRestore are shared by restore and by compaction, which reads its input back through the same path. CompactBytesRead is the compaction share of BytesRestore; subtract it from BytesRestore to get what restore itself read.
  • CompactMergeTime does not overlap DeserializeTime or ReadIOTime. 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

  1. Start from FlushTime. When spilling dominates a query, FlushTime is usually the largest value in the group, and the upstream operator’s wait time typically tracks it.
  2. Split FlushTime into its two stages (sorted writer only): FlushTime = FlushMemTableTime + CompactTime.
    • FlushMemTableTime dominates: writing the data out the first time is the cost. Compare SerializeTime against LocalWriteIOTime and RemoteWriteIOTime to tell CPU-bound serialization from a slow device, and check BytesFlush for how much data is involved. A wide table, or one whose columns are mostly NULL, makes serialization the larger of the two.
    • CompactTime dominates: the query keeps producing enough sorted block groups to hit the merge threshold, and the same data is being rewritten. CompactCount is the number of rounds and CompactBlockCount the number of block groups they consumed. CompactBytesRead and CompactBytesWritten against BytesRestore and BytesFlush give the write amplification compaction adds; when they approach the totals, most of the I/O is rewriting rather than making progress.
  3. Look at CompactMergeTime inside CompactTime. 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 CompactTime is then the read side (ReadIOTime, DeserializeTime) or the write side (SerializeTime, WriteIOTime), and those counters say which.
  4. Check for concurrency limits. PeakFlushIOTaskCount and PeakRestoreIOTaskCount show how many I/O tasks ever ran at once; a high FlushIOTaskYieldCount means flush tasks repeatedly ran out of their time slice and had to be resubmitted.
  5. Do not add overlapping counters together. See Overlapping counters before treating the group as a breakdown of FlushTime.