mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 03:58:29 +00:00
170f94fc08
* feat: enable pruning for manipulate plans Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * apply to other plans and add sqlness case Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix scalar manipulate and histogram fold for missing some columns Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * don't drop every columns Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * remove unrelated part Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
40 lines
1.3 KiB
SQL
40 lines
1.3 KiB
SQL
CREATE TABLE promql_column_pruning (
|
|
ts TIMESTAMP(3) TIME INDEX,
|
|
job STRING,
|
|
instance STRING,
|
|
region STRING,
|
|
greptime_value DOUBLE,
|
|
PRIMARY KEY(job, instance, region),
|
|
);
|
|
|
|
INSERT INTO promql_column_pruning VALUES
|
|
(0, 'job1', 'instance1', 'region1', 1),
|
|
(0, 'job1', 'instance2', 'region1', 2),
|
|
(0, 'job2', 'instance1', 'region1', 3),
|
|
(5000, 'job1', 'instance1', 'region1', 4),
|
|
(5000, 'job1', 'instance2', 'region1', 5),
|
|
(5000, 'job2', 'instance1', 'region1', 6),
|
|
(10000, 'job1', 'instance1', 'region1', 7),
|
|
(10000, 'job1', 'instance2', 'region1', 8),
|
|
(10000, 'job2', 'instance1', 'region1', 9);
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
TQL ANALYZE (0, 10, '5s') sum(promql_column_pruning);
|
|
|
|
-- SQLNESS REPLACE (metrics.*) REDACTED
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
TQL ANALYZE (0, 10, '5s') sum(rate(promql_column_pruning[5s]));
|
|
|
|
DROP TABLE promql_column_pruning;
|