This commit is contained in:
Denis Zhuravlev 2021-03-04 16:58:12 -04:00
parent 102a0b2c5d
commit c0eefb644e
2 changed files with 4 additions and 1 deletions

View File

@ -1 +1,2 @@
[('a',10)] [('a',10)]
[('a',10)]

View File

@ -1,5 +1,7 @@
DROP TABLE IF EXISTS ttt01746; DROP TABLE IF EXISTS ttt01746;
CREATE TABLE ttt01746 (d Date, n UInt64) ENGINE = MergeTree() PARTITION BY toMonday(d) ORDER BY n; CREATE TABLE ttt01746 (d Date, n UInt64) ENGINE = MergeTree() PARTITION BY toMonday(d) ORDER BY n;
INSERT INTO ttt01746 SELECT toDate('2021-02-14') + (number % 30) AS d, number AS n FROM numbers(100000); INSERT INTO ttt01746 SELECT toDate('2021-02-14') + (number % 30) AS d, number AS n FROM numbers(1500000);
set optimize_move_to_prewhere=0;
SELECT arraySort(x -> x.2, [tuple('a', 10)]) AS X FROM ttt01746 WHERE d >= toDate('2021-03-03') - 2 ORDER BY n LIMIT 1; SELECT arraySort(x -> x.2, [tuple('a', 10)]) AS X FROM ttt01746 WHERE d >= toDate('2021-03-03') - 2 ORDER BY n LIMIT 1;
SELECT arraySort(x -> x.2, [tuple('a', 10)]) AS X FROM ttt01746 PREWHERE d >= toDate('2021-03-03') - 2 ORDER BY n LIMIT 1;
DROP TABLE ttt01746; DROP TABLE ttt01746;