yuqi1129 commented on code in PR #10105:
URL: https://github.com/apache/gravitino/pull/10105#discussion_r2870291949
##########
scripts/mysql/schema-1.2.0-mysql.sql:
##########
@@ -500,3 +500,27 @@ CREATE TABLE IF NOT EXISTS `partition_statistic_meta` (
PRIMARY KEY (`table_id`, `partition_name`(255), `statistic_name`),
KEY `idx_table_partition` (`table_id`, `partition_name`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT 'partition
statistics metadata';
+
+-- Optimizer metrics schema
+CREATE TABLE IF NOT EXISTS `table_metrics` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment
id',
+ `table_identifier` VARCHAR(1024) NOT NULL COMMENT 'normalized table
identifier',
+ `metric_name` VARCHAR(1024) NOT NULL COMMENT 'metric name',
+ `table_partition` VARCHAR(1024) DEFAULT NULL COMMENT 'normalized partition
identifier',
+ `metric_ts` BIGINT(20) NOT NULL COMMENT 'metric timestamp in epoch
seconds',
+ `metric_value` VARCHAR(1024) NOT NULL COMMENT 'metric value payload',
+ PRIMARY KEY (`id`),
+ KEY `idx_table_metrics_metric_ts` (`metric_ts`),
+ KEY `idx_table_metrics_composite` (`table_identifier`(255),
`table_partition`(255), `metric_ts`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT 'optimizer
table metrics';
+
+CREATE TABLE IF NOT EXISTS `job_metrics` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment
id',
+ `job_identifier` VARCHAR(1024) NOT NULL COMMENT 'normalized job
identifier',
+ `metric_name` VARCHAR(1024) NOT NULL COMMENT 'metric name',
+ `metric_ts` BIGINT(20) NOT NULL COMMENT 'metric timestamp in epoch
seconds',
+ `metric_value` VARCHAR(1024) NOT NULL COMMENT 'metric value payload',
+ PRIMARY KEY (`id`),
+ KEY `idx_job_metrics_metric_ts` (`metric_ts`),
Review Comment:
Creating an index with a timestamp field only is not advised. Can you give
me more details about the query scenarios?
##########
scripts/h2/schema-1.2.0-h2.sql:
##########
@@ -510,3 +510,30 @@ CREATE TABLE IF NOT EXISTS partition_statistic_meta (
);
CREATE INDEX IF NOT EXISTS idx_table_partition ON
partition_statistic_meta(table_id, partition_name);
+
+-- Optimizer metrics schema
+CREATE TABLE IF NOT EXISTS `table_metrics` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'auto increment
id',
+ `table_identifier` VARCHAR(1024) NOT NULL COMMENT 'normalized table
identifier',
+ `metric_name` VARCHAR(1024) NOT NULL COMMENT 'metric name',
+ `table_partition` VARCHAR(1024) DEFAULT NULL COMMENT 'normalized partition
identifier',
+ `metric_ts` BIGINT(20) NOT NULL COMMENT 'metric timestamp in epoch
seconds',
+ `metric_value` VARCHAR(1024) NOT NULL COMMENT 'metric value payload',
Review Comment:
Is 1024 long enough for the content value?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]