Updated on 2025-08-25 GMT+08:00

Overview

Database performance tuning is the process of optimizing database system configuration and SQL queries to improve database performance and efficiency. The purpose includes eliminating performance bottlenecks, reducing response times, increasing throughput and resource utilization, cutting costs, and improving system stability.

This section provides comprehensive guidance for database administrators on performance diagnosis, system tuning, and SQL tuning, as well as practical examples of SQL tuning.

Precautions

Database tuning is a complex process that requires familiarity with the internal workings and related technologies of the database system. It requires a comprehensive consideration of various factors such as hardware, software, queries, configuration, and data structures to achieve optimal performance and efficiency. Consequently, tuning professionals must possess extensive and profound knowledge of system software architecture, hardware and software configurations, database configuration parameters, query processing, and database applications.

Performance Tuning Process

Figure 1 illustrates the performance tuning process.

Figure 1 DataArts Fabric SQL performance tuning

Table 1 gives a brief introduction to each phase of the performance tuning process.

Table 1 Phase-by-phase introduction to DataArts Fabric SQL performance tuning

Phase

Description

System Optimization

Conduct system-level tuning to more effectively utilize the node's CPU, memory, I/O, and networking resources, enhancing query throughput.

SQL Tuning

Analyze the SQL statements used and determine whether any optimization can be performed. Analysis of SQL statements comprises:

  • Generating table statistics using ANALYZE: The ANALYZE statement collects statistics about the database table content. Statistical results are stored in the system catalog PG_STATISTIC. The execution plan generator uses these statistics to determine which one is the most effective execution plan.
  • Analyzing the execution plan: The EXPLAIN statement displays the execution plan of SQL statements, and the EXPLAIN PERFORMANCE statement displays the execution time of each operator in SQL statements.
  • Identifying the root causes of issues: Identify possible causes by analyzing the execution plan and perform specific optimization by modifying database-level SQL optimization parameters.
  • Compiling better SQL statements: Compile better SQL statements in the scenarios, such as cache of intermediate and temporary data for complex queries, result set cache, and result set combination.