Tables managed by the daemon

2023-08-15 11:20:59  Updated

This topic describes the tables managed by the daemon in MonitorDB and the partitioning rules for these tables.

Tables managed in MonitorDB

Table name Partitioning rule Partition naming rule Partition retention time Lead time in partition creation
cluster_system_event Daily p + the start time of partition creation each day in microseconds, for example: p1628870400000000. 31 days 2 days
ocp_metric_data_1 Daily p + the start time of partition creation each day in seconds, for example: p1629907200. 8 days 2 days
ocp_metric_data_60 Daily p + the start time of partition creation each day in seconds, for example: p1629907200. 31 days 2 days
metric_hour_data Yearly p + year, for example: p2021. 3 years 1 year
metric_daily_data Yearly p + year, for example: p2021. 3 years 1 year
ob_hist_partition_stats_compressed Yearly p + year, for example: p2021. 3 years 1 year
ob_hist_active_session_stat_0 Daily P + date, for example: P20210911. 8 days 8 days
ob_hist_sql_audit_stat_0 Daily P + date, for example: P20210911. 2 days 8 days
ob_hist_sql_audit_stat_1 Daily P + date, for example: P20210911. 8 days 8 days
ob_hist_sql_audit_stat_2 Daily P + date, for example: P20210911. 15 days 8 days
ob_hist_sql_audit_stat Daily P + date, for example: P20210911. 30 days 8 days
ocp_perf_sql_diagnosis_task Daily P + date, for example: P20210911. 30 days 8 days
ocp_perf_sql_diagnosis Daily P + date, for example: P20210911. 30 days 8 days
ob_hist_sqltext Daily P + date, for example: P20210911. 30 days 8 days
ob_hist_plan_cache_plan_stat_0 Daily P + date, for example: P20210911. 30 days 8 days
ob_hist_plan_cache_plan Daily P + date, for example: P20210911. 30 days 8 days
ob_hist_plan_cache_plan_explain Daily P + date, for example: P20210911. 30 days 8 days
ob_hist_sql_audit_sample Daily P + date, for example: P20210911. 7 days 8 days
ob_hist_snapshot Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_cluster Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_tenant Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_sysstat Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_replica Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_server Monthly P + date, for example: P202110. 93 days 8 days
ob_hist_row_lock Monthly P + date, for example: P202110. 93 days 8 days

Examples

The following example shows the partitioning of the metric_daily_data table.

> show create table metric_daily_data\G
*************************** 1. row ***************************
       Table: metric_daily_data
Create Table: CREATE TABLE `metric_daily_data` (
  `series_id` bigint(20) NOT NULL COMMENT 'The serial number of the metric',
  'timestamp' bigint(20) NOT NULL COMMENT 'The timestamp, in seconds',
  `value` double NOT NULL COMMENT 'The value',
  PRIMARY KEY (`series_id`, `timestamp`)
) DEFAULT CHARSET = utf8mb4 COMMENT = 'The daily monitoring data of the metric'
 partition by range columns(`timestamp`)
(partition DUMMY values less than (0),
partition p2019 values less than (1577836800),
partition p2020 values less than (1609459200),
partition p2021 values less than (1640995200),
partition p2022 values less than (1672531200),
partition p2023 values less than (1704067200));

A partition of the metric_daily_data table is named in the p + year format. The partition is created 1 year in advance and retained for 3 years. The partitioning timestamp is in the UTC format. Partitions in the preceding example:

  • p2019 indicates that a partition named p2019 is created to retain the data with `timestamp` less than 1577836800.

  • The p2019, p2020, and p2021 partitions retain historical data.

  • The p2022 partition retains data of this year.

  • p2023 is a partition created in advance.

Contact Us