Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zwangsheng committed Sep 26, 2023
1 parent 313b42b commit 3e4083d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
SELECT '< KYUUBI-5131: Create index on metastore.create_time' AS ' ';
SELECT '< KYUUBI-5327: Introduce priority in metadata' AS ' ';

ALTER TABLE metadata ADD COLUMN priority int default 10 COMMENT 'the application priority, high value means high priority';

-- mysql 5.7 does not support mix order index
-- mysql 8 allow create mix order index and can be used in order by
-- here create it in 5.7 won't cause error
-- In mysql 5.7, A key_part specification can end with ASC or DESC.
-- These keywords are permitted for future extensions for specifying ascending or descending index value storage.
-- Currently, they are parsed but ignored; index values are always stored in ascending order.
-- In mysql 8 this can take effect and this index will be hit if query order by priority DESC, create_time ASC.
-- See more detail in:
-- https://dev.mysql.com/doc/refman/8.0/en/index-hints.html
-- https://dev.mysql.com/doc/refman/8.0/en/create-index.html
-- https://dev.mysql.com/doc/refman/5.7/en/create-index.html
ALTER TABLE metadata ADD INDEX priority_create_time_index(priority DESC, create_time ASC);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS metadata(
request_name varchar(1024) COMMENT 'the request name',
request_conf mediumtext COMMENT 'the request config map',
request_args mediumtext COMMENT 'the request arguments',
create_time bigint NOT NULL COMMENT 'the metadata create time',
create_time BIGINT NOT NULL COMMENT 'the metadata create time',
engine_type varchar(32) NOT NULL COMMENT 'the engine type',
cluster_manager varchar(128) COMMENT 'the engine cluster manager',
engine_open_time bigint COMMENT 'the engine open time',
Expand All @@ -24,14 +24,12 @@ CREATE TABLE IF NOT EXISTS metadata(
engine_state varchar(32) COMMENT 'the engine application state',
engine_error mediumtext COMMENT 'the engine application diagnose',
end_time bigint COMMENT 'the metadata end time',
priority int DEFAULT 10 COMMENT 'the application priority, high value means high priority',
priority int DEFAULT 10 COMMENT 'the application priority, high value means high priority',
peer_instance_closed boolean default '0' COMMENT 'closed by peer kyuubi instance',
UNIQUE INDEX unique_identifier_index(identifier),
INDEX user_name_index(user_name),
INDEX engine_type_index(engine_type),
INDEX create_time_index(create_time),
-- mysql 5.7 does not support mix order index
-- mysql 8 allow create mix order index and can be used in order by
-- here create it in 5.7 won't cause error
-- See more detail about this index in ./005-KYUUBI-5327.mysql.sql
INDEX priority_create_time_index(priority DESC, create_time ASC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

0 comments on commit 3e4083d

Please sign in to comment.