mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-09 07:20:39 +00:00
* fix: improve Grafana metrics dashboards (#8298) * chore: initial changes Signed-off-by: evenyag <realevenyag@gmail.com> * feat: improve troubleshooting dashboard Signed-off-by: evenyag <realevenyag@gmail.com> * chore: rm troubleshooting-dashboard.md Signed-off-by: evenyag <realevenyag@gmail.com> * chore: optimize metrics dashboard Signed-off-by: evenyag <realevenyag@gmail.com> * docs: move troubleshooting-dashboard.md Signed-off-by: evenyag <realevenyag@gmail.com> * chore: move mito gc duration panel Signed-off-by: evenyag <realevenyag@gmail.com> * chore: cleanup the dashboard - Overview trend panels are now aggregate-only: - Total Ingestion Rate Trend - Total Query Rate Trend - Protocol breakdowns remain in Ingestion and Queries. - Mito Backpressure and Failures no longer duplicates scan/GC signals. - Removed Write Stall per Instance. - Split Object Store and WAL into collapsed Object Store and collapsed WAL. - Moved WAL/logstore panels out of Storage into WAL. - Normalized OpenDAL “other request” matchers. - Normalized trigger elapsed p99/p75/avg aggregation. - Regenerated standalone JSON and dashboard YAML/Markdown. - Updated docs/troubleshooting-dashboard.md. Signed-off-by: evenyag <realevenyag@gmail.com> * fix: rearrange metasrv dashboard panels Signed-off-by: evenyag <realevenyag@gmail.com> * feat: improve troubleshooting dashboard layout Signed-off-by: evenyag <realevenyag@gmail.com> * docs: remove obsolete troubleshooting dashboard doc Signed-off-by: evenyag <realevenyag@gmail.com> * fix: correct cluster dashboard panel queries (missing _bucket, raw counters, rate normalization) Signed-off-by: evenyag <realevenyag@gmail.com> * fix: correct trigger panel datasource, collapse flush/compaction, split request latency panels Signed-off-by: evenyag <realevenyag@gmail.com> * fix: update grafana metrics dashboard panels Signed-off-by: evenyag <realevenyag@gmail.com> * fix: correct Grafana dashboard units Signed-off-by: evenyag <realevenyag@gmail.com> * chore: regenerate Grafana dashboards Signed-off-by: evenyag <realevenyag@gmail.com> * fix: use throughput unit for index IO bytes Signed-off-by: evenyag <realevenyag@gmail.com> --------- Signed-off-by: evenyag <realevenyag@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: redact Kafka SASL password in debug output (#8337) ## Summary - Mask `KafkaClientSaslConfig` password fields in debug output while keeping usernames visible. - Cover metasrv WAL debug output with a regression test. ## Files - `src/common/wal/src/config/kafka/common.rs` - `src/common/wal/src/config.rs` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(query): run optimizer rules before MergeScan (#8339) * fix(query): push down join filters before MergeScan Signed-off-by: discord9 <discord9@163.com> * fix(query): run optimizer before MergeScan pushdown Signed-off-by: discord9 <discord9@163.com> * fix(query): narrow pre-MergeScan filter pushdown Signed-off-by: discord9 <discord9@163.com> * fix(query): refine pre-MergeScan optimizer prepass Signed-off-by: discord9 <discord9@163.com> * fix(query): satisfy predicate extractor clippy Signed-off-by: discord9 <discord9@163.com> * test(query): cover pre-MergeScan optimizer edges Signed-off-by: discord9 <discord9@163.com> * test(query): cover set comparison prepass Signed-off-by: discord9 <discord9@163.com> * fix(query): guard remote scan filter pushdown Signed-off-by: discord9 <discord9@163.com> * fix(query): preserve subquery planning errors Signed-off-by: discord9 <discord9@163.com> * fix(query): preserve usable scan predicates Signed-off-by: discord9 <discord9@163.com> * fix(query): simplify scan predicate extraction Signed-off-by: discord9 <discord9@163.com> * fix(query): keep scan filter extraction scoped Signed-off-by: discord9 <discord9@163.com> * docs(query): explain pre-MergeScan optimizer Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: preserve bulk write grpc error details (#8349) Signed-off-by: jeremyhi <fengjiachun@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: include index files in GC listing (#8327) * fix: include index files in GC listing Signed-off-by: discord9 <discord9@163.com> * chore: filter GC index listing to puffins Signed-off-by: discord9 <discord9@163.com> * chore: simplify GC index listing stream Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: stream tables for prometheus label discovery (#8341) Signed-off-by: Ritwij Aryan Parmar <ritwij.aryan.parmar@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: account parquet metadata cache size (#8368) * fix: account parquet metadata cache size Use Parquet metadata memory sizing for SST metadata cache weight and add regression coverage for byte-array page-index buffers. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * fix: saturate sst meta cache weight Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> --------- Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: respect gc mailbox timeout for admin gc (#8363) Signed-off-by: discord9 <discord9@163.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: record catalog and schema in slow queries (#8387) * fix: record catalog and schema in slow queries Add catalog and schema context to slow query records while appending the new columns after existing fields to preserve column order. - `src/common/frontend/src/slow_query_event.rs`: extend `SlowQueryEvent` schema and rows with `catalog_name` and `schema_name`, and cover append-only ordering. - `src/catalog/src/process_manager.rs`: carry catalog and schema through `SlowQueryTimer`. - `src/frontend/src/instance.rs`: capture context for SQL, plan, and PromQL slow query timers. - `tests-integration/tests/sql.rs`: assert MySQL and PostgreSQL slow query records include catalog and schema. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: address slow query review comment Use `String::clone` when writing slow query catalog and schema values. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: keep slow query schema only Remove the slow query `catalog_name` column and keep `schema_name` as a non-null tag dimension. - `src/common/frontend/src/slow_query_event.rs`: expose only `schema_name` in `SlowQueryEvent` rows and mark it as a tag. - `src/catalog/src/process_manager.rs`: stop carrying catalog context in `SlowQueryTimer`. - `src/frontend/src/instance.rs`: pass only schema context to slow query timers. - `tests-integration/tests/sql.rs`: assert slow query records include `schema_name` without `catalog_name`. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: schema name semantic should be field Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix: typo Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> --------- Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: invalidate comment DDL cache and lock by object ID (#8390) * fix: invalidate comment ddl cache locally Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: fix typos Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: apply suggestions Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: client_ip error logs skip internal API (#8362) * chore: client_ip error logs skip internal API Signed-off-by: shuiyisong <xixing.sys@gmail.com> * fix: fmt Signed-off-by: shuiyisong <xixing.sys@gmail.com> * chore: use const Signed-off-by: shuiyisong <xixing.sys@gmail.com> * chore: use const Signed-off-by: shuiyisong <xixing.sys@gmail.com> --------- Signed-off-by: shuiyisong <xixing.sys@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * feat: update dashboard to v0.13.6 (#8369) Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: use ENV for building dashboard (#8384) Signed-off-by: shuiyisong <xixing.sys@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * fix: handle PromQL time binary aggregation (#8398) Signed-off-by: jeremyhi <fengjiachun@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * perf(mito): prune files by manifest time range (#8352) * perf(mito): prune files by manifest time range Signed-off-by: discord9 <discord9@163.com> * chore(mito): address file pruning review Signed-off-by: discord9 <discord9@163.com> * chore(mito): remove verbose file pruning log Signed-off-by: discord9 <discord9@163.com> * chore(mito): expose file pruning metric Signed-off-by: discord9 <discord9@163.com> * chore(mito): shorten file pruning metric Signed-off-by: discord9 <discord9@163.com> * test(mito): cover file pruning edge cases Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * perf(mito): skip manifest-pruned file ranges (#8366) * perf(mito): skip manifest-pruned file ranges Signed-off-by: discord9 <discord9@163.com> * test(mito): allow empty prune benchmark output Signed-off-by: discord9 <discord9@163.com> * fix(mito): avoid caching stale pruned builders Signed-off-by: discord9 <discord9@163.com> * chore(mito): address pruner clippy Signed-off-by: discord9 <discord9@163.com> * fix(mito): account worker pruner builder metrics Signed-off-by: discord9 <discord9@163.com> * test(mito): keep empty prune benchmark local Signed-off-by: discord9 <discord9@163.com> * refactor(mito): share manifest-pruned range skip Signed-off-by: discord9 <discord9@163.com> * chore(mito): shorten prune cache comment Signed-off-by: discord9 <discord9@163.com> * fix(mito): keep manifest prune state in pruner Signed-off-by: discord9 <discord9@163.com> * test(mito): cover manifest prune fast skip edge cases Signed-off-by: discord9 <discord9@163.com> * chore: fix typo in logical table alter Signed-off-by: discord9 <discord9@163.com> * chore(mito): address pruner review comments Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com> Signed-off-by: WenyXu <wenymedia@gmail.com> * chore: bump version to v1.1.2 Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: evenyag <realevenyag@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> Signed-off-by: discord9 <discord9@163.com> Signed-off-by: jeremyhi <fengjiachun@gmail.com> Signed-off-by: Ritwij Aryan Parmar <ritwij.aryan.parmar@gmail.com> Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> Signed-off-by: shuiyisong <xixing.sys@gmail.com> Co-authored-by: Yingwen <realevenyag@gmail.com> Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com> Co-authored-by: discord9 <discord9@163.com> Co-authored-by: jeremyhi <jiachun_feng@proton.me> Co-authored-by: Ritwij Aryan Parmar <88580521+RitwijParmar@users.noreply.github.com> Co-authored-by: shuiyisong <113876041+shuiyisong@users.noreply.github.com> Co-authored-by: sun <sunchang_long@163.com>
646 lines
17 KiB
Plaintext
646 lines
17 KiB
Plaintext
CREATE TABLE integers(i INTEGER, j TIMESTAMP TIME INDEX);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers WHERE i IN ((SELECT i FROM integers)) ORDER BY i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: integers.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: integers.i = __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: __correlated_sq_1_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_REDACTED
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1.i) ORDER BY i1.i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: i1.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: i1.i = __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: i1_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: __correlated_sq_1_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_REDACTED
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_RepartitionExec: partitioning=REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
create table other (i INTEGER, j TIMESTAMP TIME INDEX);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
explain select t.i
|
|
from (
|
|
select * from integers join other on 1=1
|
|
) t
|
|
where t.i is not null
|
|
order by t.i desc;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: t.i DESC NULLS FIRST_|
|
|
|_|_SubqueryAlias: t_|
|
|
|_|_Cross Join:_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Filter: integers.i IS NOT NULL AND Boolean(true)_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL, Boolean(true)] |
|
|
|_| ]]_|
|
|
|_|_Projection:_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| TableScan: other_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 DESC]_|
|
|
|_|_SortExec: expr=[i@0 DESC], preserve_partitioning=[true]_|
|
|
|_|_CrossJoinExec_|
|
|
|_|_CoalescePartitionsExec_|
|
|
|_|_ProjectionExec: expr=[i@0 as i]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_ProjectionExec: expr=[]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
INSERT INTO other SELECT i, 2 FROM integers WHERE i=(SELECT MAX(i) FROM integers);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Explain physical plan for DML is not supported because it looks up the table name in a way that is
|
|
-- different from normal queries. It also requires the table provider to implement the `insert_into()` method.
|
|
EXPLAIN INSERT INTO other SELECT i, 2 FROM integers WHERE i=(SELECT MAX(i) FROM integers);
|
|
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
| plan_type | plan |
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
| logical_plan | Dml: op=[Insert Into] table=[other] |
|
|
| | Projection: integers.i AS i, TimestampMillisecond(2, None) AS j |
|
|
| | Inner Join: integers.i = __scalar_sq_1.max(integers.i) |
|
|
| | Projection: integers.i |
|
|
| | MergeScan [is_placeholder=false, remote_input=[ |
|
|
| | TableScan: integers |
|
|
| | ]] |
|
|
| | MergeScan [is_placeholder=false, remote_input=[ |
|
|
| | SubqueryAlias: __scalar_sq_1 |
|
|
| | Projection: max(integers.i) |
|
|
| | Aggregate: groupBy=[[]], aggr=[[max(integers.i)]] |
|
|
| | TableScan: integers, partial_filters=[Boolean(true)] |
|
|
| | ]] |
|
|
| physical_plan_error | This feature is not implemented: Insert into not implemented for this table |
|
|
+---------------------+-----------------------------------------------------------------------------+
|
|
|
|
drop table other;
|
|
|
|
Affected Rows: 0
|
|
|
|
drop table integers;
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE integers(i INTEGER, j TIMESTAMP TIME INDEX)
|
|
PARTITION ON COLUMNS (i) (
|
|
i < 1000,
|
|
i >= 1000 AND i < 2000,
|
|
i >= 2000
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT i FROM integers WHERE i=i1.i) ORDER BY i1.i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: i1.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: i1.i = __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: i1_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: __correlated_sq_1_|
|
|
|_|_Projection: integers.i_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT * FROM integers i1 WHERE EXISTS(SELECT count(i) FROM integers WHERE i=i1.i) ORDER BY i1.i;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: i1.i ASC NULLS LAST_|
|
|
|_|_LeftSemi Join: i1.i = __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: i1_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
|_|_Projection: __correlated_sq_1.i_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: __correlated_sq_1_|
|
|
|_|_Projection: count(integers.i), integers.i_|
|
|
|_|_Aggregate: groupBy=[[integers.i]], aggr=[[count(integers.i)]]_|
|
|
|_|_Filter: integers.i IS NOT NULL_|
|
|
|_|_TableScan: integers, partial_filters=[integers.i IS NOT NULL]_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [i@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[i@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_ProjectionExec: expr=[i@1 as i]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
DROP TABLE integers;
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE t(ts timestamp time index, a INT, b INT)PARTITION ON COLUMNS (a) (
|
|
a < 1000,
|
|
a >= 1000 AND a < 2000,
|
|
a >= 2000
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE t1(ts timestamp time index, a INT)PARTITION ON COLUMNS (a) (
|
|
a < 1000,
|
|
a >= 1000 AND a < 2000,
|
|
a >= 2000
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE t2(ts timestamp time index, a INT)PARTITION ON COLUMNS (a) (
|
|
a < 1000,
|
|
a >= 1000 AND a < 2000,
|
|
a >= 2000
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
INSERT INTO t(ts,a,b) VALUES (1,3,30),(2,1,10),(3,2,20);
|
|
|
|
Affected Rows: 3
|
|
|
|
INSERT INTO t1(ts,a) VALUES (1,1),(2,3);
|
|
|
|
Affected Rows: 2
|
|
|
|
INSERT INTO t2(ts,a) VALUES (1,2),(2,3);
|
|
|
|
Affected Rows: 2
|
|
|
|
SELECT x FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+---+
|
|
| x |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expected: 1,2,3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT x FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| MergeSort: sq.x ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Projection: sq.x_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT x, COUNT(*) AS c FROM (SELECT a AS x FROM t) sq GROUP BY x ORDER BY x;
|
|
|
|
+---+---+
|
|
| x | c |
|
|
+---+---+
|
|
| 1 | 1 |
|
|
| 2 | 1 |
|
|
| 3 | 1 |
|
|
+---+---+
|
|
|
|
-- expected:
|
|
-- x | c
|
|
-- 1 | 1
|
|
-- 2 | 1
|
|
-- 3 | 1
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT x, COUNT(*) AS c FROM (SELECT a AS x FROM t) sq GROUP BY x ORDER BY x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| MergeSort: sq.x ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Projection: sq.x, count(Int64(1)) AS count(*) AS c_|
|
|
|_|_Aggregate: groupBy=[[sq.x]], aggr=[[count(Int64(1))]]_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT DISTINCT x FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+---+
|
|
| x |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expecetd: 1,2,3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT DISTINCT x FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Aggregate: groupBy=[[sq.x]], aggr=[[]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Distinct:_|
|
|
|_|_Projection: sq.x_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[x@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_AggregateExec: mode=SinglePartitioned, gby=[x@0 as x], aggr=[]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT sq.x FROM (SELECT a AS x FROM t) sq ORDER BY sq.x;
|
|
|
|
+---+
|
|
| x |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expected: 1,2,3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT sq.x FROM (SELECT a AS x FROM t) sq ORDER BY sq.x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| MergeSort: sq.x ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Projection: sq.x_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT y FROM (SELECT x AS y FROM (SELECT a AS x FROM t) sq1) sq2 ORDER BY y;
|
|
|
|
+---+
|
|
| y |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expected: 1,2,3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT y FROM (SELECT x AS y FROM (SELECT a AS x FROM t) sq1) sq2 ORDER BY y;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| MergeSort: sq2.y ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Sort: sq2.y ASC NULLS LAST_|
|
|
|_|_Projection: sq2.y_|
|
|
|_|_SubqueryAlias: sq2_|
|
|
|_|_Projection: sq1.x AS y_|
|
|
|_|_SubqueryAlias: sq1_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [y@0 ASC NULLS LAST]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT x, x + 1 AS y FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+---+---+
|
|
| x | y |
|
|
+---+---+
|
|
| 1 | 2 |
|
|
| 2 | 3 |
|
|
| 3 | 4 |
|
|
+---+---+
|
|
|
|
-- expected:
|
|
-- (x,y)
|
|
-- (1,2)
|
|
-- (2,3)
|
|
-- (3,4)
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT x, x + 1 AS y FROM (SELECT a AS x FROM t) sq ORDER BY x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| MergeSort: sq.x ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Projection: sq.x, CAST(sq.x AS Int64) + Int64(1) AS y_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT a FROM ((SELECT a FROM t1) UNION ALL (SELECT a FROM t2)) u ORDER BY a;
|
|
|
|
+---+
|
|
| a |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expected: 1,2,3,3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT a FROM ((SELECT a FROM t1) UNION ALL (SELECT a FROM t2)) u ORDER BY a;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: u.a ASC NULLS LAST_|
|
|
|_|_SubqueryAlias: u_|
|
|
|_|_Union_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Projection: t1.a_|
|
|
|_|_TableScan: t1_|
|
|
|_| ]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Projection: t2.a_|
|
|
|_|_TableScan: t2_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [a@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[a@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_InterleaveExec_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT u1.a
|
|
FROM (SELECT a FROM t1) u1
|
|
JOIN (SELECT a FROM t2) u2 ON u1.a = u2.a
|
|
ORDER BY u1.a;
|
|
|
|
+---+
|
|
| a |
|
|
+---+
|
|
| 3 |
|
|
+---+
|
|
|
|
-- expected: 3
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT u1.a
|
|
FROM (SELECT a FROM t1) u1
|
|
JOIN (SELECT a FROM t2) u2 ON u1.a = u2.a
|
|
ORDER BY u1.a;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: u1.a ASC NULLS LAST_|
|
|
|_|_Projection: u1.a_|
|
|
|_|_Inner Join: u1.a = u2.a_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: u1_|
|
|
|_|_Projection: t1.a_|
|
|
|_|_Filter: t1.a IS NOT NULL_|
|
|
|_|_TableScan: t1, partial_filters=[t1.a IS NOT NULL]_|
|
|
|_| ]]_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| SubqueryAlias: u2_|
|
|
|_|_Projection: t2.a_|
|
|
|_|_Filter: t2.a IS NOT NULL_|
|
|
|_|_TableScan: t2, partial_filters=[t2.a IS NOT NULL]_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [a@0 ASC NULLS LAST]_|
|
|
|_|_SortExec: expr=[a@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT x FROM (VALUES (2),(1)) v(x) ORDER BY x;
|
|
|
|
+---+
|
|
| x |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
+---+
|
|
|
|
-- expected: 1,2
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT x FROM (VALUES (2),(1)) v(x) ORDER BY x;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Sort: v.x ASC NULLS LAST_|
|
|
|_|_SubqueryAlias: v_|
|
|
|_|_Projection: column1 AS x_|
|
|
|_|_Values: (Int64(2)), (Int64(1))_|
|
|
| physical_plan | SortExec: expr=[x@0 ASC NULLS LAST], preserve_partitioning=[false] |
|
|
|_|_ProjectionExec: expr=[column1@0 as x]_|
|
|
|_|_DataSourceExec: partitions=1, partition_sizes=[1]_|
|
|
|_|_|
|
|
+-+-+
|
|
|
|
SELECT x FROM (SELECT a AS x FROM t) sq ORDER BY x LIMIT 2;
|
|
|
|
+---+
|
|
| x |
|
|
+---+
|
|
| 1 |
|
|
| 2 |
|
|
+---+
|
|
|
|
-- expected: 1,2
|
|
-- SQLNESS REPLACE (-+) -
|
|
-- SQLNESS REPLACE (\s\s+) _
|
|
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
|
|
-- SQLNESS REPLACE (Hash.*) REDACTED
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
EXPLAIN SELECT x FROM (SELECT a AS x FROM t) sq ORDER BY x LIMIT 2;
|
|
|
|
+-+-+
|
|
| plan_type_| plan_|
|
|
+-+-+
|
|
| logical_plan_| Limit: skip=0, fetch=2_|
|
|
|_|_MergeSort: sq.x ASC NULLS LAST_|
|
|
|_|_MergeScan [is_placeholder=false, remote_input=[_|
|
|
|_| Limit: skip=0, fetch=2_|
|
|
|_|_Sort: sq.x ASC NULLS LAST_|
|
|
|_|_Projection: sq.x_|
|
|
|_|_SubqueryAlias: sq_|
|
|
|_|_Projection: t.a AS x_|
|
|
|_|_TableScan: t_|
|
|
|_| ]]_|
|
|
| physical_plan | SortPreservingMergeExec: [x@0 ASC NULLS LAST], fetch=2_|
|
|
|_|_SortExec: TopK(fetch=2), expr=[x@0 ASC NULLS LAST], preserve_partitioning=[true]_|
|
|
|_|_MergeScanExec: REDACTED
|
|
|_|_|
|
|
+-+-+
|
|
|
|
DROP TABLE t;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE t1;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE t2;
|
|
|
|
Affected Rows: 0
|
|
|