diff --git a/tests/cases/standalone/common/create/create_metric_table.result b/tests/cases/standalone/common/create/create_metric_table.result index 743fbe41db6b..a0b6e782dd19 100644 --- a/tests/cases/standalone/common/create/create_metric_table.result +++ b/tests/cases/standalone/common/create/create_metric_table.result @@ -288,6 +288,17 @@ SHOW CREATE TABLE phy; | | ) | +-------+---------------------------------------------------------------------------------+ +SHOW INDEX FROM phy; + ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ +| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ +| phy | 1 | PRIMARY, INVERTED INDEX | 3 | __table_id | A | | | | YES | greptime-primary-key-v1, greptime-inverted-index-v1 | | | YES | | +| phy | 1 | PRIMARY | 4 | __tsid | A | | | | YES | greptime-primary-key-v1 | | | YES | | +| phy | 1 | PRIMARY, SKIPPING INDEX | 5 | host | A | | | | YES | greptime-primary-key-v1, greptime-bloom-filter-v1 | | | YES | | +| phy | 1 | TIME INDEX | 1 | ts | A | | | | NO | | | | YES | | ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ + DROP TABLE t1; Affected Rows: 0 diff --git a/tests/cases/standalone/common/create/create_metric_table.sql b/tests/cases/standalone/common/create/create_metric_table.sql index 43c75172b0fb..7589a14f34b7 100644 --- a/tests/cases/standalone/common/create/create_metric_table.sql +++ b/tests/cases/standalone/common/create/create_metric_table.sql @@ -97,6 +97,8 @@ CREATE TABLE t1 (ts timestamp time index, val double, host string primary key) e SHOW CREATE TABLE phy; +SHOW INDEX FROM phy; + DROP TABLE t1; DROP TABLE phy; diff --git a/tests/cases/standalone/common/show/show_create.result b/tests/cases/standalone/common/show/show_create.result index 8e6cb006eacf..df7acddb7f08 100644 --- a/tests/cases/standalone/common/show/show_create.result +++ b/tests/cases/standalone/common/show/show_create.result @@ -260,6 +260,32 @@ show create table phy; | | ) | +-------+---------------------------------------------------------------------------------+ +CREATE TABLE t1 ( + ts TIMESTAMP TIME INDEX, + val DOUBLE, + job STRING PRIMARY KEY +) ENGINE=metric WITH ( + "on_physical_table" = "phy" +); + +Affected Rows: 0 + +show index from phy; + ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ +| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ +| phy | 1 | PRIMARY, INVERTED INDEX | 4 | __table_id | A | | | | YES | greptime-primary-key-v1, greptime-inverted-index-v1 | | | YES | | +| phy | 1 | PRIMARY | 5 | __tsid | A | | | | YES | greptime-primary-key-v1 | | | YES | | +| phy | 1 | PRIMARY, SKIPPING INDEX | 3 | host | A | | | | YES | greptime-primary-key-v1, greptime-bloom-filter-v1 | | | YES | | +| phy | 1 | PRIMARY, SKIPPING INDEX | 6 | job | A | | | | YES | greptime-primary-key-v1, greptime-bloom-filter-v1 | | | YES | | +| phy | 1 | TIME INDEX | 1 | ts | A | | | | NO | | | | YES | | ++-------+------------+-------------------------+--------------+-------------+-----------+-------------+----------+--------+------+-----------------------------------------------------+---------+---------------+---------+------------+ + +drop table t1; + +Affected Rows: 0 + drop table phy; Affected Rows: 0 diff --git a/tests/cases/standalone/common/show/show_create.sql b/tests/cases/standalone/common/show/show_create.sql index 434d57615cd1..d7c9a30bdad3 100644 --- a/tests/cases/standalone/common/show/show_create.sql +++ b/tests/cases/standalone/common/show/show_create.sql @@ -100,6 +100,18 @@ WITH( show create table phy; +CREATE TABLE t1 ( + ts TIMESTAMP TIME INDEX, + val DOUBLE, + job STRING PRIMARY KEY +) ENGINE=metric WITH ( + "on_physical_table" = "phy" +); + +show index from phy; + +drop table t1; + drop table phy; show create table numbers;