mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-07 13:52:59 +00:00
* column options Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * handle table constrain Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update test assertions Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * change inverted index table constrain usage Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * don't create inverted index for pk on alter table Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove remaining pk-as-inverted-index Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * more inverted index magic Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result again Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * Update src/sql/src/statements.rs Co-authored-by: jeremyhi <jiachun_feng@proton.me> * drop support for index def in table constrain Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: jeremyhi <jiachun_feng@proton.me>
54 lines
1.1 KiB
SQL
54 lines
1.1 KiB
SQL
CREATE TABLE IF NOT EXISTS system_metrics (
|
|
host STRING,
|
|
idc STRING FULLTEXT INDEX INVERTED INDEX,
|
|
cpu_util DOUBLE,
|
|
memory_util DOUBLE,
|
|
disk_util DOUBLE,
|
|
desc1 STRING,
|
|
desc2 STRING FULLTEXT INDEX,
|
|
desc3 STRING FULLTEXT INDEX,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(host, idc),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS test (
|
|
a STRING,
|
|
b STRING SKIPPING INDEX,
|
|
c DOUBLE,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(a, b),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS test_no_inverted_index (
|
|
a STRING,
|
|
b STRING SKIPPING INDEX,
|
|
c DOUBLE,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(a, b),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
show create table test_no_inverted_index;
|
|
|
|
SHOW INDEX;
|
|
|
|
SHOW INDEX FROM test;
|
|
|
|
SHOW INDEX FROM test_no_inverted_index;
|
|
|
|
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;
|
|
|
|
DROP TABLE test_no_inverted_index;
|