tencent cloud

Tencent Cloud TCHouse-D

Product Introduction
Overview
Concepts
Cluster Architecture
Strengths
Scenarios
Purchase Guide
Billing Overview
Renewal Instructions
Overdue Policy
Refund Instructions
Configuration Adjustment Billing Instructions
Getting Started
Using Tencent Cloud TCHouse-D Through the Console
Using Tencent Cloud TCHouse-D Through a Client
Operation Guide
Cluster Operation
Monitoring and Alarm Configuration
Account Privilege Management
Data Management
Query Management
Modify Configurations
Node Management
Log Analysis
SQL Studio
Enabling Resource Isolation
Development Guide
Design of Data Table
Importing Data
Exporting Data
Basic Feature
Query Optimization
Ecological Expansion Feature
API Documentation
History
Introduction
API Category
Making API Requests
Cluster Operation APIs
Database and Table APIs
Cluster Information Viewing APIs
Hot-Cold Data Layering APIs
Database and Operation Audit APIs
User and Permission APIs
Resource Group Management APIs
Data Types
Error Codes
Cloud Ecosystem
Granting CAM Policies to Sub-accounts
Query Acceleration for Tencent Cloud DLC
Practical Tutorial
Basic Feature Usage
Advanced Features Usage
Resource Specification Selection and Optimization Suggestions
Naming Specifications and Limits to the Database and Data Table
Table Design and Data Import
Query Optimization
Suggested Usage to Avoid
Accessing TCHouse-D via JDBC over the Public Network
Performance Testing
TPC-H Performance Testing
SSB Performance Testing
TPC-DS Performance Testing
FAQs
Common Operational Issues
Common Errors
Contact Us
Glossary
Product Policy
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement

Query Optimization

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-07-31 09:17:42

Basic Query Optimization

When querying a partition table, be sure to include the partition field.Explain + SQL can help users analyze and query data in several partitions and tablets.
It is best if the query SQL condition can hit the partition Key and bucket Key.
It is best if the query SQL condition can hit the prefix index.
Since Doris is a column-based database, when there are enough fields to query, the performance may be worse than row-based storage. It is recommended to select specific fields instead of * as much as possible when querying, and add a limit number at the end of the query.
When performing a Select operation, avoid writing function(column) = "xxxx" as much as possible; otherwise, the strength of Doris system in pushing down predicates cannot be exerted. The left side shall be the column name and the right side shall be a constant value that can be calculated and flattened.
Avoid using "or, union all" in queries as much as possible. In most scenes, consider using in instead of "or". .
For SQL queries of general data exploration, if not all data is needed, it is recommended to add a limit number for the records returned, which can also speed up the query.

Join Optimization

Shuffle mode optimization: Efficiency is Colocate join > Bucket Shuffle > Shuffle > BroadCast. For details, see Bucket Shuffle Join.
RuntimeFilter : In a join query, in addition to the join condition, there are other filtering conditions on the right.

Use Rollup.

The query cannot cover the prefix index of the base table. The prefix index is formed by adjusting the Key order through Rollup.
Perform Key filtering aggregation on the Aggregate table.

Using Materialized View

If you often perform fixed-mode aggregate queries on a table, it is recommended to create a materialized view on this table.
It can be used in all scenes supported by Rollup.
An additional aggregation is formed for the Duplicate table.
For details, see Materialized View.

Index Optimization

Bitmap index: Select a column with a relatively small value cardinality [100-100,000], where the query condition hits the column.
BloomFilter index: If you often perform precise point queries on a column and the column has a high cardinality, it is recommended to create a Bloom filter index on this column.

Use cache.

PageCache: This configuration is enabled by default.
SqlCache: This configuration is disabled by default. The effect is better when the concurrency is high and the query result set is small.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック