section> Computing
  • Auto Scaling
  • Bare Metal Server
  • Dedicated Host
  • Elastic Cloud Server
  • FunctionGraph
  • Image Management Service
Network
  • Direct Connect
  • Domain Name Service
  • Elastic IP
  • Elastic Load Balancing
  • Enterprise Router
  • NAT Gateway
  • Private Link Access Service
  • Secure Mail Gateway
  • Virtual Private Cloud
  • VPC Endpoint
  • Virtual Private Network
Storage
  • Cloud Backup and Recovery
  • Cloud Server Backup Service
  • Elastic Volume Service
  • Object Storage Service
  • Storage Disaster Recovery Service
  • Scalable File Service
  • Volume Backup Service
Application Services
  • Application Operations Management
  • Application Performance Management
  • API Gateway (APIG)
  • Distributed Message Service
  • Simple Message Notification
Database Services
  • Distributed Cache Service
  • Document Database Service
  • Data Replication Service
  • GaussDB (for MySQL)
  • GeminiDB
  • Relational Database Service
Big Data and Data Analysis
  • Cloud Search Service
  • DataArts Studio
  • Data Ingestion Service
  • Data Lake Insight
  • Data Warehouse Service
  • ModelArts
  • MapReduce Service
  • Optical Character Recognition
Container Services
  • Cloud Container Engine
  • Software Repository for Containers
Applications and Databases
  • Anti DDoS
  • Database Security Service
  • Host Security Service
  • Web Application Firewall
  • Dedicated Web Application Firewall
Identity and Access Management
  • Identity and Access Management Service
Key Management
  • Key Management Service
Compliance
  • Core Services Certifications
Monitoring and Logging
  • Cloud Eye
  • Cloud Trace Service
  • Log Tank Service
Resource Management
  • Cloud Create
  • Resource Management Service
  • Tag Management Service
Other
  • Enterprise Dashboard
  • Price API
  • Price Calculator
APIs
  • REST API
  • API Usage Guidelines
  • Endpoints
Development and Automation
  • SDKs
  • Drivers and Tools
  • Terraform
  • Ansible
  • Cloud Create
Architecture Center
  • Best Practices
  • Blueprints
Other
  • Status Dashboard
  • Portfolio Roadmap
  • Training Certifications
IaaSComputingAuto ScalingBare Metal ServerDedicated HostElastic Cloud ServerFunctionGraphImage Management ServiceNetworkDirect ConnectDomain Name ServiceElastic IPElastic Load BalancingEnterprise RouterNAT GatewayPrivate Link Access ServiceSecure Mail GatewayVirtual Private CloudVPC EndpointVirtual Private NetworkStorageCloud Backup and RecoveryCloud Server Backup ServiceElastic Volume ServiceObject Storage ServiceStorage Disaster Recovery ServiceScalable File ServiceVolume Backup ServicePaaSApplications ServicesApplication Operation ManagementApplication Performance ManagementAPI Gateway (APIG)Distributed Message ServiceSimple Message NotificationDatabase ServicesDistributed Cache ServiceDocument Database ServiceData Replication ServiceGaussDB (for MySQL)GeminiDBRelational Database ServiceBig Data and Data AnalysisCloud Search ServiceDataArts StudioData Ingestion ServiceData Lake InsightData Warehouse ServiceModelArtsMapReduce ServiceOptical Character RecognitionContainer ServicesCloud Container EngineSoftware Repository for ContainersSecurityApplications and DatabasesAnti DDoSDatabase Security ServiceHost Security ServiceWeb Application FirewallDedicated Web Application FirewallIdentity and Access ManagementIdentity and Access Management ServiceKey ManagementKey Management ServiceComplianceCore Services CertificationsManagementMonitoring and LoggingCloud EyeCloud Tracking ServiceLog Tank ServiceResource ManagementCloud CreateResource Management ServiceTag Management ServiceOtherEnterprise DashboardPrice APIPrice CalculatorDevelopersAPIsREST APIAPI Usage GuidelinesEndpointsAutomation and DevelopmentSDKsDrivers and ToolsTerraformAnsibleCloud CreateArchitecture CenterBest PracticesBlueprintsOtherStatus DashboardPortfolio RoadmapTraining Certifications

Data Warehouse Service

  • Service Overview
  • Getting Started
  • Process for Using GaussDB(DWS)
  • Preparations
  • Creating or Deleting a Cluster
  • Cluster Connection
  • Monitoring and Alarms
  • Specifications Change and Scaling
  • Backup and Disaster Recovery
  • Intelligent O&M
  • Cluster Management
  • Cluster Log Management
  • Database User Management
  • Audit Logs
  • Cluster Security Management
  • Resource Management
  • Data Source Management
  • Managing Logical Clusters
  • FAQs
    • Product Consulting
    • Database Connections
    • Data Migration
    • Database Usage
    • Cluster Management
    • Account Permissions
    • Database Performance
      • Why Is SQL Execution Slow After Long GaussDB(DWS) Usage?
      • Why Does GaussDB(DWS) Perform Worse Than a Single-Server Database in Extreme Scenarios?
      • How Do I View SQL Execution Records of a Certain Period When GaussDB(DWS) Service Read and Write Are Blocked?
      • GaussDB(DWS) CPU Resource Management
      • Why Is the Execution of Common GaussDB(DWS) User Slower Than That of User dbadmin?
      • What Are the Factors Related to the Single-Table Query Performance in GaussDB(DWS)?
    • Backup and Restoration
  • Change History
  • User Guide
  • FAQs
  • Database Performance
  • What Are the Factors Related to the Single-Table Query Performance in GaussDB(DWS)?

What Are the Factors Related to the Single-Table Query Performance in GaussDB(DWS)?¶

GaussDB(DWS) uses the shared-nothing architecture, and data is stored in a distributed manner. Therefore, the distribution key, data volume, and number of partitions affect the overall query performance of a single table.

  1. Distribution Key Design

    By default, GaussDB(DWS) takes the first column of the primary key as the distribution key. When you define both a primary key and a distribution key for a table, the distribution key must be a subset of the primary key. Distribution keys determine data distribution among partitions. If distribution keys are well distributed among partitions, query performance can be improved.

    If the distribution key is incorrectly selected, data skew may occur after data is imported. The usage of some disks may be much higher than that of other disks, and the cluster may become read-only in some extreme cases. Proper selection of distribution keys is critical to table query performance. In addition, proper distribution keys enable data indexes to be created and maintained more quickly.

  2. Data Volume Stored in a Single Table

    The larger the amount of data stored in a single table, the poorer the query performance. If a table contains a large amount of data, you need to store the data in partitions. To convert an ordinary table to a partitioned table, you need to create a partitioned table and import data to it from the ordinary table. When you design tables, plan whether to use partitioned tables based on service requirements.

    To partition a table, comply with the following principles:

    • Use fields with obvious ranges for partitioning, for example, date or region.

    • The partition name must reflect the data characteristics of the partition. For example, its format can be Keyword+Range characteristics.

    • Set the upper limit of a partition to MAXVALUE to prevent data overflow.

  3. Number of Partitions

    Tables and indexes can be divided into smaller and easier-to-manage units. This significantly reduces search space and improves access performance.

    The number of partitions affects the query performance. If the number of partitions is too small, the query performance may deteriorate.

    GaussDB(DWS) supports range partitioning and list partitioning. In range partitioning, records are divided and inserted into multiple partitions of a table. Each partition stores data of a specific range (ranges in different partitions do not overlap). List partitioning is supported only by clusters of 8.1.3 and later versions.

When designing a data warehouse, you need to consider these factors and perform experiments to determine the optimal design scheme.

  • Prev
  • Next
last updated: 2025-05-05 13:43 UTC - commit: 25fa3546aa0855323cc0af49d41cb4f0d0882749
Edit pageReport Documentation Bug
Page Contents
  • What Are the Factors Related to the Single-Table Query Performance in GaussDB(DWS)?
© T-Systems International GmbH
  • Contact
  • Data privacy
  • Disclaimer of liabilitys
  • Imprint