Performance and Tuning
Tune performance by identifying a bottleneck, changing one relevant setting or design choice, and measuring the same workload again. Start with the tuning workflow, then use query profiles to choose schema, plan, cache, or execution changes. The optimization principles explain how the query engine makes these decisions.
Tuning methodology
Query performance
Schema and Index Optimization
Choose a table model, partition and bucket keys, sort keys, and indexes to reduce the work required by your queries.
Materialized View
Precompute reusable results with synchronous or asynchronous materialized views, and verify whether the optimizer rewrites matching queries.
Join Optimization
Use Colocation Join for compatible bucketed tables and hints to adjust join distribution or order when measurements show a better plan.
Caching Acceleration
Reuse query results, filter computations, or remote data with the cache appropriate to your workload.
Execution Tuning
Use the query profile to decide whether to adjust parallelism, runtime filter wait time, data distribution, or optimizer rules.
High Concurrency and Point Queries
Use row storage and short-circuit execution for eligible Unique Key point queries, or consider dictionary lookups for repeated dimension access.
Distinct Counts
Choose bitmap aggregation for exact distinct counts in a supported value domain or HyperLogLog for approximate cardinality estimates.
Query Profile
Analyze the time distribution of operators such as Scan, Exchange, Join, and aggregation through the Profile to quickly locate the slowest stage of a query.
Load performance
Optimization technology principles
Query Optimizer
Introduces rule rewriting and the cost model of the Nereids optimizer, including rule-based equivalent transformations and cost-based Join Enumeration.
Pipeline Execution Engine
Understand the pipeline model, task scheduling, and morsel-driven parallel execution used by the query engine.
Runtime Filter
Introduces the execution mechanism by which RuntimeFilter is generated on the Join build side and pushed down to the probe side to skip irrelevant data.
TopN Optimization
Understand runtime filtering, key-prefix scans, and lazy materialization for eligible ORDER BY ... LIMIT queries.
Statistics
Introduces the collection and use of statistics such as tables, columns, and histograms, which are the foundation for the cost-based query optimizer to choose plans.
Benchmarks
Star Schema Benchmark (SSB)
Review attributed Apache Doris SSB results and their test configuration before comparing them with your own workload.
TPC-H
Review attributed Apache Doris TPC-H results, data loading conditions, and query measurements.
TPC-DS
Review attributed Apache Doris TPC-DS results for multi-table analytical queries.