mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-24 17:00:37 +00:00
* feat: cache each uncompressed page * chore: remove unused function * chore: log * chore: log * chore: row group pages cache kv * feat: also support row group level cache * chore: fix range count * feat: don't cache compressed page for row group cache * feat: use function to get part * chore: log whether scan is from compaction * chore: avoid get column * feat: add timer metrics * chore: Revert "feat: add timer metrics" This reverts commit 4618f57fa2ba13b1e1a8dec83afd01c00ae4c867. * feat: don't cache individual uncompressed page * feat: append in row group level under append mode Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * chore: fetch pages cost * perf: yield * Update src/mito2/src/sst/parquet/row_group.rs * refactor: cache key * feat: print file num and row groups num in explain * test: update sqlness test * chore: Update src/mito2/src/sst/parquet/page_reader.rs --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
101 lines
3.8 KiB
Plaintext
101 lines
3.8 KiB
Plaintext
create table demo(ts timestamp time index, `value` double, host string,idc string, collector string, primary key(host, idc, collector));
|
|
|
|
Affected Rows: 0
|
|
|
|
insert into demo values(1,2,'test1', 'idc1', 'disk') ,(2,3,'test2', 'idc1', 'disk'), (3,4,'test3', 'idc2','memory');
|
|
|
|
Affected Rows: 3
|
|
|
|
select * from demo where host='test1';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.001 | 2.0 | test1 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where host='test2';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.002 | 3.0 | test2 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where host='test3';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.003 | 4.0 | test3 | idc2 | memory |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where host='test2' and idc='idc1';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.002 | 3.0 | test2 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where host='test2' and idc='idc1' and collector='disk';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.002 | 3.0 | test2 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where host='test2' and idc='idc2';
|
|
|
|
++
|
|
++
|
|
|
|
select * from demo where host='test3' and idc>'idc1';
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.003 | 4.0 | test3 | idc2 | memory |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where idc='idc1' order by ts;
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.001 | 2.0 | test1 | idc1 | disk |
|
|
| 1970-01-01T00:00:00.002 | 3.0 | test2 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
select * from demo where collector='disk' order by ts;
|
|
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| ts | value | host | idc | collector |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
| 1970-01-01T00:00:00.001 | 2.0 | test1 | idc1 | disk |
|
|
| 1970-01-01T00:00:00.002 | 3.0 | test2 | idc1 | disk |
|
|
+-------------------------+-------+-------+------+-----------+
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
explain analyze select * from demo where idc='idc1';
|
|
|
|
+-+-+-+
|
|
| stage | node | plan_|
|
|
+-+-+-+
|
|
| 0_| 0_|_MergeScanExec: REDACTED
|
|
|_|_|_|
|
|
| 1_| 0_|_SeqScan: region=REDACTED, partition_count=1 (1 memtable ranges, 0 file 0 ranges) REDACTED
|
|
|_|_|_|
|
|
|_|_| Total rows: 2_|
|
|
+-+-+-+
|
|
|
|
drop table demo;
|
|
|
|
Affected Rows: 0
|
|
|