mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-07 22:40:38 +00:00
fix: global limit for distributed inspect streams
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
This commit is contained in:
69
tests/cases/distributed/information_schema/ssts_limit.result
Normal file
69
tests/cases/distributed/information_schema/ssts_limit.result
Normal file
@@ -0,0 +1,69 @@
|
||||
CREATE TABLE ssts_limit_case (
|
||||
a INT PRIMARY KEY INVERTED INDEX,
|
||||
b STRING SKIPPING INDEX,
|
||||
c STRING FULLTEXT INDEX,
|
||||
ts TIMESTAMP TIME INDEX,
|
||||
)
|
||||
PARTITION ON COLUMNS (a) (
|
||||
a < 1000,
|
||||
a >= 1000 AND a < 2000,
|
||||
a >= 2000
|
||||
);
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
INSERT INTO ssts_limit_case VALUES
|
||||
(500, 'a', 'a', 1),
|
||||
(1500, 'b', 'b', 2),
|
||||
(2500, 'c', 'c', 3);
|
||||
|
||||
Affected Rows: 3
|
||||
|
||||
ADMIN FLUSH_TABLE('ssts_limit_case');
|
||||
|
||||
+--------------------------------------+
|
||||
| ADMIN FLUSH_TABLE('ssts_limit_case') |
|
||||
+--------------------------------------+
|
||||
| 0 |
|
||||
+--------------------------------------+
|
||||
|
||||
SELECT COUNT(DISTINCT node_id) > 1 AS has_multi_datanodes
|
||||
FROM information_schema.ssts_manifest;
|
||||
|
||||
+---------------------+
|
||||
| has_multi_datanodes |
|
||||
+---------------------+
|
||||
| true |
|
||||
+---------------------+
|
||||
|
||||
SELECT COUNT(*) AS limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
+--------------+
|
||||
| limited_rows |
|
||||
+--------------+
|
||||
| 1 |
|
||||
+--------------+
|
||||
|
||||
SELECT COUNT(*) AS filtered_limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
WHERE region_id > 0
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
+-----------------------+
|
||||
| filtered_limited_rows |
|
||||
+-----------------------+
|
||||
| 1 |
|
||||
+-----------------------+
|
||||
|
||||
DROP TABLE ssts_limit_case;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
38
tests/cases/distributed/information_schema/ssts_limit.sql
Normal file
38
tests/cases/distributed/information_schema/ssts_limit.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
CREATE TABLE ssts_limit_case (
|
||||
a INT PRIMARY KEY INVERTED INDEX,
|
||||
b STRING SKIPPING INDEX,
|
||||
c STRING FULLTEXT INDEX,
|
||||
ts TIMESTAMP TIME INDEX,
|
||||
)
|
||||
PARTITION ON COLUMNS (a) (
|
||||
a < 1000,
|
||||
a >= 1000 AND a < 2000,
|
||||
a >= 2000
|
||||
);
|
||||
|
||||
INSERT INTO ssts_limit_case VALUES
|
||||
(500, 'a', 'a', 1),
|
||||
(1500, 'b', 'b', 2),
|
||||
(2500, 'c', 'c', 3);
|
||||
|
||||
ADMIN FLUSH_TABLE('ssts_limit_case');
|
||||
|
||||
SELECT COUNT(DISTINCT node_id) > 1 AS has_multi_datanodes
|
||||
FROM information_schema.ssts_manifest;
|
||||
|
||||
SELECT COUNT(*) AS limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
SELECT COUNT(*) AS filtered_limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
WHERE region_id > 0
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
DROP TABLE ssts_limit_case;
|
||||
@@ -202,6 +202,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test;
|
||||
| physical_plan after FilterPushdown(Post)_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after WindowedSortRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after MatchesConstantTerm_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after EnsureGlobalLimitForFetch_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after RemoveDuplicateRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after SanityCheckPlan_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan_| CooperativeExec_|
|
||||
@@ -353,6 +354,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test AS series;
|
||||
| physical_plan after FilterPushdown(Post)_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after WindowedSortRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after MatchesConstantTerm_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after EnsureGlobalLimitForFetch_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after RemoveDuplicateRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after SanityCheckPlan_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan_| CooperativeExec_|
|
||||
@@ -578,6 +580,7 @@ TQL EXPLAIN VERBOSE (0, 10, '5s') test_nano;
|
||||
| physical_plan after FilterPushdown(Post)_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after WindowedSortRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after MatchesConstantTerm_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after EnsureGlobalLimitForFetch_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after RemoveDuplicateRule_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan after SanityCheckPlan_| SAME TEXT AS ABOVE_|
|
||||
| physical_plan_| PromInstantManipulateExec: range=[0..10000], lookback=[300000], interval=[5000], time index=[j]_|
|
||||
|
||||
Reference in New Issue
Block a user