Skip to main content
VeloDB Cloud 26.x is based on Apache Doris 4.x. See Version Mapping.

Performance Tuning Process

Identify a slow query, inspect its schema and plan, then measure its runtime behavior. Use diagnostic tools to find the query and analysis tools to choose a targeted change.

Prepare to tune the query:

  • You have confirmed the presence of slow SQL or performance degradation.
  • You can view Query Audit, Query Profile, and cluster metrics for the warehouse.
  • You are familiar with the schema design and query patterns of the business tables.
  • You understand basic analysis tools such as EXPLAIN and Profile.

The complete four-step tuning process is as follows:

Performance tuning process

StepPhaseCore GoalMain Tools
Step 1Slow query identificationIdentify the SQL statements that need tuningQuery Audit, Sessions, SQL Editor query history
Step 2Schema tuningEliminate design-level bottlenecksPartitioning and bucketing, indexes, Colocate Group
Step 3Plan tuningOptimize the execution planEXPLAIN, materialized views, Hint
Step 4Execution tuningOptimize runtime performanceProfile, Runtime Filter, parallelism parameters

Step 1: Identify slow queries​

Goal: Filter out the slow SQL statements in the business system that need tuning.

Approach:

ScenarioRecommended approachDescription
The query has completedUse Query Audit.Filter the incident time range and record the query ID, SQL, duration, and resource usage.
The query is still runningUse Sessions.Inspect the current SQL and execution details.

For more information on tool usage, see Diagnostic tools.

Step 2: Check the schema​

After identifying the slow SQL, first check the business schema design to rule out performance issues caused at the design level. Schema tuning covers three areas:

Tuning DirectionMain ContentReference Documentation
Table-level schema tuningNumber of partitions and buckets, field typesOptimize table schema
Index design tuningPrefix index, Bloom filter, inverted index, and so onOptimize table index
Specific optimization techniquesColocate Group, and so onUse Colocate Group to optimize Join

For detailed cases, see Plan tuning.

Step 3: Tune the plan​

After completing the schema check, you enter the main tuning phase. This phase makes full use of the EXPLAIN tool at the relevant level of detail to systematically analyze the execution plan of the slow SQL and locate the key optimization points.

Tuning techniques by scenario:

For detailed cases, see Plan tuning.

Step 4: Tune execution​

In the execution tuning phase, you need to verify the effect of plan tuning based on the actual runtime behavior of the SQL, and continue to analyze execution-side bottlenecks, such as time distribution across execution stages or insufficient parallelism.

Check a multi-table analytical query with Query Profile:

  • Whether the Join order chosen by the planner is reasonable.
  • Whether Runtime Filter takes effect.
  • Whether the parallelism meets expectations.
  • Machine load (such as slow IO or network transmission performance not meeting expectations).

For resource-pressure issues, compare the query with Metrics for the same cluster and time range. For detailed cases, see Execution tuning.

Tip:

When analyzing a specific performance issue, the recommended order is to check the plan first and tune the execution second. First use EXPLAIN to confirm the execution plan, and then use Profile to locate execution performance issues. Reversing the order may lead to inefficiency and make it harder to quickly identify the problem.

FAQ​

Q1: Should you do schema tuning or plan tuning first?

Schema tuning should be done first. Unreasonable schema design (such as incorrect partitioning/bucketing fields or missing necessary indexes) prevents the execution plan itself from being optimized. Resolving schema issues first avoids repeatedly tuning on top of a flawed foundation.

Q2: What is the difference between EXPLAIN and Profile?

ToolOutputPhase of Use
EXPLAINStatic execution plan (does not actually run)Plan tuning
ProfileRuntime time and resource metrics from actual executionExecution tuning

Q3: What should you do when the Join Order is not reasonable?

Examine the EXPLAIN output and use Leading Hint to manually specify the Join order.

Q4: How do you handle issues such as slow IO or slow network?

Compare Query Profile with cluster metrics for I/O, remote storage, cache hit rate, CPU, memory, and network throughput. If the resource charts do not explain the issue, provide the query ID and time range to VeloDB Cloud support.

Summary​

VeloDB Cloud provides multi-dimensional tuning tools that support full-chain diagnosis from slow query identification, schema design, and execution plans to runtime performance. Business users and DBAs are encouraged to follow the four-step process of "identification -> schema -> plan -> execution" for systematic tuning, so as to fully unleash the performance advantages of VeloDB Cloud.