Skip to main content

Performance Tuning Overview

Query performance tuning is a systematic effort that requires evaluating and optimizing the database system across multiple layers and dimensions. From a practitioner's perspective, this article introduces the overall workflow, methodology, and tooling system for Apache Doris performance tuning.

Opening Checklist: Confirm Before You Start Tuning

Before getting into specific tuning work, complete the following preparation:

  • You understand the hardware configuration of the business system (CPU, memory, disk, network).
  • You have confirmed the size of the Doris cluster (number of FE/BE nodes).
  • You have confirmed the Doris software version and the features it supports.
  • You can distinguish between "slow business" and "slow SQL," and pinpoint the specific problematic SQL.
  • You are familiar with the available diagnostic and analysis tools.

1. Performance Tuning Methodology

Performance tuning in one sentence: First understand the system, then locate slow SQL, then use tools to find bottlenecks, and finally apply optimizations.

1.1 The Four-Step Tuning Method

The following table summarizes the core workflow of performance tuning:

StepGoalKey Actions
1Understand the systemKnow the hardware, cluster size, Doris version, and version-specific features
2Locate the problematic SQLUse diagnostic tools to efficiently and quickly identify slow SQL
3Analyze performance bottlenecksUse Doris built-in tools and general operating system tools to collect runtime information
4Apply tuningBased on the bottleneck analysis, adjust parameters, rewrite SQL, and apply optimizations such as indexes and materialized views

1.2 Description of Each Step

  • Step 1: Understand the system. Business users and DBAs need to build a comprehensive understanding of the database system in use to avoid investigating problems in the wrong direction.
  • Step 2: Locate slow SQL. A useful performance diagnostic tool is a prerequisite for locating performance issues. Subsequent work is meaningful only after the problematic SQL is quickly identified.
  • Step 3: Analyze bottlenecks. Combine Doris-specific tools (such as Profile and Explain) with general operating system tools (such as top and iostat) to determine where the bottleneck lies.
  • Step 4: Apply optimizations. Based on detailed runtime information and supplementary analysis, adjust configuration or rewrite SQL in a targeted way.

2. The Tuning Toolset Provided by Doris

Apache Doris provides corresponding tools at every layer of the tuning workflow. The following table maps tools to scenarios:

Tool CategoryProblem It SolvesDocumentation Entry
Diagnostic ToolsQuickly locate slow SQL and problematic SQLDiagnostic Tools
Analysis ToolsAnalyze SQL execution details and bottlenecksAnalysis Tools
Tuning ProcessComplete end-to-end tuning practice guideTuning Process

3. FAQ and Common Misconceptions

Q1: Does performance tuning have to start with rewriting SQL?

Not necessarily. Tuning should start with "understanding the system + locating slow SQL." Skipping these two steps and jumping straight to rewriting SQL often misses the real bottleneck.

Q2: Are Doris built-in tools alone enough?

No. General operating system tools (such as top, iostat, and vmstat) serve as supplementary aids that help identify resource bottlenecks in CPU, IO, and memory.

Q3: Is tuning the DBA's job alone?

No. Performance tuning requires collaboration among business users, DBAs, and even developers: business users understand the SQL semantics, while DBAs understand the cluster and database characteristics.

4. Next Steps