The statistics information log table, `hologres.hg_table_info`, collects table metadata, such as creation time and storage size, to enable fine-grained table administration. Hologres provides a table index diagnosis feature that analyzes this metadata across multiple dimensions, including storage format and index settings. This helps you manage tables more efficiently and improves the stability and query performance of your instance.
Notes
-
Table index diagnosis data is sourced from the `hologres.hg_table_info` statistics information system table. The data is updated with a T+1 delay. By default, the page displays data from the previous day and does not support queries for data from the current day.
-
The permissions required to query this data are the same as those for the `hg_table_info` table. For details, see Grant view permissions.
Procedure
Use HoloWeb to view table index diagnosis results visually.
-
Log on to the HoloWeb console. For more information, see Connect to HoloWeb and run a query.
-
In the top navigation bar, click Diagnostics and Optimization.
-
In the navigation pane on the left, choose Instance Diagnosis > Table Index Diagnostics.
-
At the top of the Table Index Diagnostics page, select the Instance Name and Time for the instance that you want to diagnose.
-
Click Submit to view the total number of databases, table groups, tables (foreign and internal), and views for the selected instance, along with other diagnosis results.
Usage guidance and recommendations
After you select an instance to diagnose, the system displays data from the previous day by default. The following table describes each diagnosis item and provides a recommendation.
|
Diagnosis Item |
Description |
Recommendation |
|
Number of tables and views per database |
Shows the total number of internal tables, partitioned child tables, foreign tables, and views in each database of the selected instance. |
Prioritize the administration of databases that contain many tables. |
|
Number of internal tables per table group |
Shows the number of internal tables (including partitioned child tables) in each table group. |
|
|
Number and storage size of partitioned tables |
Shows the number of partitioned child tables and their storage size for each partitioned table in the selected instance. |
|
|
Tables with zero storage |
Shows tables with zero storage in both hot and cold tiers. |
Promptly delete tables with zero storage to reduce metadata memory usage. |
|
Tables using Segment format |
Lists all tables in the selected instance that use Segment format storage. Hologres V2.0 and later no longer support Segment format tables. You must manually convert these tables to the Optimized Row Columnar (ORC) format. The ORC format uses a more efficient compression algorithm, which reduces storage costs and can improve performance. If you do not convert these tables, you cannot upgrade your instance to V2.0 or later. For conversion steps, see Change the data storage format of a column-oriented table. Important
The conversion table format for the instance must be version 1.3.6x or later. Otherwise, the conversion may fail and affect the normal operation of the instance. |
None. |
|
Row-oriented tables |
Lists all row-oriented tables in the selected instance. |
|
|
Hybrid store tables |
Lists all hybrid store tables in the selected instance. |
Hybrid store tables are suitable for all scenarios but use double the amount of storage. Use them with caution. For details, see Table storage formats: column store, row store, and hybrid store. You can use the following SQL statement to find queries that target a specific hybrid store table.
|
|
Row-oriented tables without a primary key (PK) |
Row-oriented tables are designed for primary key–based queries and require a primary key (PK) to function effectively. |
|
|
Row-oriented tables with mismatched distribution key and clustering key |
The distribution key and clustering key of a row-oriented table must use the same field. Mismatched keys can add query overhead and reduce performance. |
|
|
Column-oriented tables with more than 300 columns |
Avoid creating column-oriented tables with more than 300 columns. Many columns increases performance overhead. For details, see Best practices. |
|
|
Hybrid store tables with more than 300 columns |
Avoid creating hybrid store tables with more than 300 columns. Many columns increases performance overhead. For details, see Best practices. |
|
|
Row-oriented tables with more than 300 columns |
Avoid creating row-oriented tables with more than 300 columns. Many columns increases performance overhead. For details, see Best practices. |
|
|
Tables with more than three columns in the distribution key |
The distribution key determines how data is distributed. In join scenarios, a well-chosen distribution key enables local joins and reduces data shuffling. However, using more than three columns can limit its effectiveness. Keep the distribution key to three columns or fewer. For details, see Distribution Key. |
|
|
Tables with more than three columns in the clustering key |
The clustering key sorts data within files and is commonly used for range filtering. It follows a left-matching rule. Avoid using more than three columns, because this limits index hit scenarios. For details, see Clustering Key. |
|
|
Tables with more than three columns in the segment key |
The segment key defines file boundaries and is often used with monotonic fields, such as timestamps, for filtering. It follows a left-matching rule. Avoid using more than three columns, because this limits index hit scenarios. For details, see Event Time Column (Segment Key). |
|
|
Tables with nullable clustering key columns |
The clustering key sorts data within files and is commonly used for range filtering. Avoid setting clustering key fields to nullable, because this disables acceleration. For details, see Clustering Key. |
Recreate the table and set the clustering key field to NOT NULL. |
|
Tables with nullable segment key columns |
The segment key defines file boundaries and is often used with monotonic fields, such as timestamps, for filtering. Avoid setting segment key fields to nullable, because this disables acceleration. For details, see Event Time Column (Segment Key). |
Recreate the table and set the segment key field to NOT NULL. |
|
Tables with TTL less than 7 days |
Time to Live (TTL) is used to manage the data lifecycle. Data is purged after its TTL expires. The exact deletion time is not guaranteed, but the deletion occurs after the expiration. A shorter TTL results in faster data deletion. We recommend that you set the TTL to at least 7 days to prevent issues such as duplicate data or accidental deletion. For details, see SQL command reference. |
|
|
All tables with Binlog enabled |
Enabling Binlog adds storage overhead. We recommend that you enable Binlog for row-oriented and hybrid store tables. Enabling Binlog for column-oriented tables incurs significant performance overhead. For details, see Subscribe to Hologres Binlog. |
|
|
Tables with Binlog TTL greater than 7 days |
Hologres Binlog records Data Manipulation Language (DML) operations. A longer Binlog TTL retains more records and increases storage overhead. We recommend that you keep the Binlog TTL within 7 days. |
For tables with a long Binlog TTL, run the following statement to reduce it:
|