The heatmap in Database Autonomy Service (DAS) visualizes query activity and data distribution across partitions in PolarDB-X databases. Use it to identify hot partitions and uneven data distribution across physical nodes.
Prerequisites
PolarDB-X V5.4.14 or later
The database uses automatic partitioning mode (AUTO mode). Only AUTO-mode databases in the current instance are shown in the heatmap — databases using other partitioning modes exist but do not appear.
How it works
The heatmap collects statistics on queried data rows per partition at regular intervals. Each cell in the central heatmap represents a partition at a point in time. Color brightness indicates query frequency — bright yellow is the highest, black is the lowest.
Three histograms around the central heatmap let you pivot the data:
Left-side histogram — by logical database, table, or partition (and by storage node when Data Node View is on)
Bottom histogram — by time
Right-side histogram — by partition
Turn on Data Node View to reorganize the data by physical storage node. This makes it easier to assess whether query load is evenly spread across nodes.
Limitations
| Constraint | Default threshold | To raise the limit |
|---|---|---|
| Partitions per logical database | 8,000 — exceeding this threshold causes the system to skip statistics collection for that database | Adjust PARTITIONS_HEATMAP_COLLECTION_MAX_SINGLE_LOGIC_SCHEMA_COUNT in PolarDB-X kernel configuration |
| Partitions per collection task | 8,000 — exceeding this threshold causes the system to collect statistics for only 8,000 partitions | Adjust PARTITIONS_HEATMAP_COLLECTION_MAX_SCAN in PolarDB-X kernel configuration |
View the heatmap
Log on to the DAS console.
In the left-side navigation pane, click Instance Monitoring.
Find the instance and click its ID to open the instance details page.
In the left-side navigation pane, click Heatmap.
Read the heatmap
Heatmap areas
| Area | What it shows |
|---|---|
| Left-side histogram | Logical databases, logical tables, and logical partitions in the instance. In Data Node View, storage nodes are also shown. Rectangle length indicates data volume — a longer rectangle means more data. |
| Bottom histogram | Total queried data rows summed over time. Click a point in time to see the total rows queried across all partitions at that moment. |
| Right-side histogram | Total queried data rows summed by partition. Click a partition to see how many rows it served in total. |
| Central heatmap | Color brightness indicates query frequency per partition per time interval. Bright yellow is the highest frequency; black is the lowest. |
Status indicators
| Status | Meaning |
|---|---|
| NO DATA | No statistics have been collected yet. |
| TOO BIG | The number of partitions displayed exceeds 3,200. When the total original partitions scanned exceeds 1,600, the system merges statistics from partitions in the same logical table on the same data node. If the partition count still exceeds 3,200 after the merge, TOO BIG is displayed. |
Hover details
Move the pointer over any cell in the heatmap to see the following details:
| Field | Description |
|---|---|
| Colored box | Color matching the heatmap cell; shows the number of data rows queried per minute during the collection period. |
| Started At | Start time of the collection period. |
| Ended At | End time of the collection period. |
| Current Number of Rows | Number of data rows in the partition when the heatmap was opened. This reflects the state at open time, not the Started At–Ended At period. |
| Data Node | Data node where the partition resides. A dash (-) means the partition no longer exists, typically due to a DDL operation or a merge during collection. |
| Database | Logical database the partition belongs to. |
| Table | Logical table the partition belongs to. |
| Partition | Name of the logical partition. |
Configure data collection
Use the following SQL commands in PolarDB-X to control how the heatmap collects data.
Each command must be preceded by set ENABLE_SET_GLOBAL = true;.Disable data collection
set ENABLE_SET_GLOBAL = true;
set global ENABLE_PARTITIONS_HEATMAP_COLLECTION = false;Statistics collected before you disable the feature remain visible in the heatmap.
Limit collection to specific databases or tables
Use PARTITIONS_HEATMAP_COLLECTION_ONLY to target specific databases and tables. The syntax is:
{database}#{table1}&{table2},{database2}#{table1}| Goal | Command |
|---|---|
Collect stats for the customer and order tables in tpcc, and the nation table in tpch | set global PARTITIONS_HEATMAP_COLLECTION_ONLY = 'tpcc#customer&order,tpch#nation'; |
Collect stats for all tables in tpcc and tpch | set global PARTITIONS_HEATMAP_COLLECTION_ONLY = 'tpcc,tpch'; |
Collect stats for the customer and order tables across all logical databases | set global PARTITIONS_HEATMAP_COLLECTION_ONLY = '#customer,#order'; or set global PARTITIONS_HEATMAP_COLLECTION_ONLY = '#customer&order'; |
| Collect stats for all tables in all logical databases (reset to default) | set global PARTITIONS_HEATMAP_COLLECTION_ONLY = ''; |
What's next
After identifying hot partitions in the heatmap, consider the following actions:
Review the partition key design of the affected tables to improve data distribution.
Adjust the collection scope using
PARTITIONS_HEATMAP_COLLECTION_ONLYto focus on the databases or tables that need monitoring.