Help Center> GaussDB> Distributed_2.x> Performance Tuning> Optimization Cases> Case: Adjusting the Table Storage Model in a Medium Table
Updated on 2023-10-23 GMT+08:00

Case: Adjusting the Table Storage Model in a Medium Table

Symptom

In the GaussDB database, row-store tables use row execution engine, and column-store tables use column execution engine. If both row-store tables and column-store tables exist in a SQL statement, the system will automatically select the row execution engine. The performance of a column execution engine (except for the index scan related operators) is much better than that of a row execution engine. Therefore, a column-store table is recommended. This is important for some intermediate result set dumping tables, and you need to select a proper table storage model.

During the test at a site, if the following execution plan is performed, the customer expects that the performance can be improved and the result can be returned within 3s.

Optimization Analysis

It is found that the row execution engine is used after analysis, because both the temporary plan table input_acct_id_tbl and the intermediate result dumping table row_unlogged_table use row storage.

After the two tables are changed into column-store tables, the system performance is improved and the result is returned by 1.6s.