mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-14 01:02:55 +00:00
* feat: define region scanner * feat: single partition scanner * feat: use single partition scanner * feat: implement ExecutionPlan wip * feat: mito engine returns single partition scanner * feat: implement DisplayAs for region server * feat: dummy table provider use handle_partitioned_query() * test: update sqlness test * feat: table provider use ReadFromRegion * refactor: remove StreamScanAdapter * chore: update lock * style: fix clippy * refactor: remove handle_query from the RegionEngine trait * chore: address CR comments * refactor: rename methods * refactor: rename ReadFromRegion to RegionScanExec
47 lines
1.2 KiB
Plaintext
47 lines
1.2 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(greptime.public.system_REDACTED
|
|
|_|_|_CoalescePartitionsExec REDACTED
|
|
|_|_|_AggregateExec: mode=Partial, gby=[], aggr=[COUNT(greptime.public.system_REDACTED
|
|
|_|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_|_SinglePartitionScanner: <SendableRecordBatchStream> REDACTED
|
|
|_|_|_|
|
|
|_|_| Total rows: 1_|
|
|
+-+-+-+
|
|
|
|
drop table system_metrics;
|
|
|
|
Affected Rows: 0
|
|
|