mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-08 22:32:55 +00:00
* refactor: RangeBase * feat: memtable range * feat: scanner use mem range * feat: remove base from mem range context * feat: impl ranges for memtables * chore: fix warnings * refactor: make predicate cheap to clone * refactor: MemRange -> MemtableRange * feat: pub empty memtable to fix warnings * test: fix sqlness result
47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
CREATE TABLE 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)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
INSERT INTO system_metrics
|
|
VALUES
|
|
("host1", "idc_a", 11.8, 10.3, 10.3, 1667446797450),
|
|
("host2", "idc_a", 80.0, 70.3, 90.0, 1667446797450),
|
|
("host1", "idc_b", 50.0, 66.7, 40.6, 1667446797450);
|
|
|
|
Affected Rows: 3
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
explain analyze SELECT count(*) FROM system_metrics;
|
|
|
|
+-+-+-+
|
|
| stage | node | plan_|
|
|
+-+-+-+
|
|
| 0_| 0_|_MergeScanExec: REDACTED
|
|
|_|_|_|
|
|
| 1_| 0_|_AggregateExec: mode=Final, gby=[], aggr=[COUNT(system_REDACTED
|
|
|_|_|_CoalescePartitionsExec REDACTED
|
|
|_|_|_AggregateExec: mode=Partial, gby=[], aggr=[COUNT(system_REDACTED
|
|
|_|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_|_SeqScan: partition_count=1 (1 memtable ranges, 0 file ranges) REDACTED
|
|
|_|_|_|
|
|
|_|_| Total rows: 1_|
|
|
+-+-+-+
|
|
|
|
drop table system_metrics;
|
|
|
|
Affected Rows: 0
|
|
|