Skip to content

Commit

Permalink
test: show index
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 17, 2025
1 parent edea1c6 commit aa6f79b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/cases/standalone/common/create/create_metric_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/standalone/common/create/create_metric_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 26 additions & 0 deletions tests/cases/standalone/common/show/show_create.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions tests/cases/standalone/common/show/show_create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa6f79b

Please sign in to comment.