Files
greptimedb/tests/cases/standalone/common/show/show_index.sql
dennis zhuang f1d17a8ba5 fix: panic while reading information_schema. KEY_COLUMN_USAGE (#4318)
* fix: table might be dropped during iteration

* fix: panic while reading information_schema.key_column_usage

* fix: key_column_usage wrong results
2024-07-09 03:30:14 +00:00

36 lines
672 B
SQL

CREATE TABLE IF NOT EXISTS system_metrics (
host STRING,
idc STRING,
cpu_util DOUBLE,
memory_util DOUBLE,
disk_util DOUBLE,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(host, idc),
TIME INDEX(ts)
);
CREATE TABLE IF NOT EXISTS test (
a STRING,
b STRING,
c DOUBLE,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(a, b),
TIME INDEX(ts)
);
SHOW INDEX;
SHOW INDEX FROM test;
SHOW INDEX FROM system_metrics;
SHOW INDEX FROM system_metrics in public;
SHOW INDEX FROM system_metrics like '%util%';
SHOW INDEX FROM system_metrics WHERE Key_name = 'TIME INDEX';
DROP TABLE system_metrics;
DROP TABLE test;