Commit Graph

759 Commits

Author SHA1 Message Date
Amos Bird
fa8fab2e8f
Fix KeyCondition with other filters 2022-08-11 19:20:44 +08:00
Vladimir Chebotaryov
748979a9c0
Merge branch 'master' into betterorderbyoptimization 2022-08-11 11:09:52 +03:00
vdimir
b7c5c54181
Fix build 2022-08-10 13:43:55 +00:00
vdimir
5eb4cd39e0
Merge branch 'master' into refactor-prepared-sets 2022-08-10 11:47:49 +00:00
Igor Nikonov
70b52f7cb9 Fix test, review comments 2022-08-09 16:29:56 +00:00
Maksim Kita
a576a55375 Fixed build 2022-08-09 15:03:59 +02:00
Igor Nikonov
366ead3828 Consider aliases when checking if sorting order is preserved by
expression
2022-08-09 11:27:17 +00:00
Igor Nikonov
1439664df6 EXPLAIN tests 2022-08-08 20:46:43 +00:00
Maksim Kita
c030fd05e7 ActionsDAG rename index to outputs 2022-08-08 18:01:32 +02:00
Igor Nikonov
15bdeba074 Fix review comments 2022-08-08 14:43:03 +00:00
Igor Nikonov
86c5280db3 Merge remote-tracking branch 'origin/master' into skipping_sorting_step 2022-08-08 12:43:06 +00:00
Igor Nikonov
6572a447fa Check if sorting order is preserved for FilterStep 2022-08-08 12:42:10 +00:00
vdimir
708747ca0b
Merge branch 'master' into refactor-prepared-sets 2022-08-08 14:27:18 +02:00
Vladimir C
6bd4821656
Merge pull request #39575 from vdimir/join_pushdown_column_not_found
Fix column not found for push down with join
2022-08-08 14:04:42 +02:00
Igor Nikonov
254d14b1d3 Remove debug trace from DistinctStep
+ this information can be seen later via EXPLAIN PLAN
2022-08-07 13:12:11 +00:00
Igor Nikonov
f52720fedc Try to fix style errors 2022-08-06 23:33:19 +00:00
Igor Nikonov
988ce29e9e Check if expression step violates sorting correctly 2022-08-06 22:37:14 +00:00
Igor Nikonov
f5f6ada69b ActionsDAG check is not dependent on sort description 2022-08-05 11:00:18 +00:00
Igor Nikonov
a70c47f780 EXPLAIN PLAN sortmode options
+ ActionsDAG fixes
2022-08-04 22:02:53 +00:00
Igor Nikonov
0a659f5ab8 Analyze ActionsDAG in ExpressionStep
+ check if sorting order can be kept from prevous step
+ EXPLAIN PLAN header=1 contains Sort Mode and Sort Description for each step
+ some tests
+ fix some review comments
2022-08-04 19:30:25 +00:00
Vladimir C
a627b00c43
Merge branch 'master' into refactor-prepared-sets 2022-08-04 13:27:38 +02:00
vdimir
298fb2431d
Fix column not found for push down with join 2022-08-04 10:58:21 +00:00
Igor Nikonov
8eafca65c9 Fix style 2022-08-02 17:58:31 +00:00
Igor Nikonov
0cb59aa38c ExpressionStep: simple check if expression changes sorting order 2022-08-02 10:45:05 +00:00
Vladimir Chebotaryov
aaa6049678
Merge branch 'master' into betterorderbyoptimization 2022-08-01 11:42:48 +03:00
Vladimir Chebotaryov
9fc3addea9 Fixed using column_after_join for handling WINDOW expressions in ExpressionAnalyzer, shall be aggregated_columns. 2022-07-31 23:36:20 +03:00
Nikolai Kochetov
22fbfe19a4 Merge branch 'master' into use-dag-in-key-condition 2022-07-31 21:54:12 +02:00
Igor Nikonov
7f0adb5eb0 Merge remote-tracking branch 'origin/master' into skipping_sorting_step 2022-07-31 07:07:36 +00:00
Igor Nikonov
a7cfad105e
Merge branch 'master' into distinct_sorted_simplify 2022-07-30 21:57:53 +02:00
Igor Nikonov
3be51a6dea Construct DistinctSortedTransform only when it makes sense
otherwise fallback to DistinctTransform (i.e. ordinary distinct)
2022-07-30 19:41:03 +00:00
Maksim Kita
8fc6bad4f4 Join enums refactoring 2022-07-29 18:35:05 +02:00
Nikolai Kochetov
59a11b32ad
Merge branch 'master' into use-dag-in-key-condition 2022-07-29 17:01:33 +02:00
Igor Nikonov
fb5799fe7f More generic getInputOrderInfo() in query info 2022-07-29 14:36:36 +00:00
Vladimir C
115506356c
Merge branch 'master' into refactor-prepared-sets 2022-07-27 19:57:23 +02:00
Anton Popov
1547c010b9
Merge pull request #39432 from ClickHouse/distinct_sorted_chunk_perf_impr
DISTINCT in order: perf improvement
2022-07-27 14:17:58 +02:00
vdimir
8eecb9ef82
upd PreparedSets: rename/change signature of methods, add comments 2022-07-27 11:22:16 +00:00
vdimir
d9928ac93d
Add methods to SubqueryForSet, do not use refernce to SetPtr 2022-07-26 18:39:09 +00:00
vdimir
1e3fa2e01f
Refactor PreparedSets/SubqueryForSet 2022-07-26 18:39:02 +00:00
Nikolai Kochetov
d7cc3831ea Push predicate over StorageMerge. 2022-07-26 15:01:39 +00:00
Nikolai Kochetov
b70be40804
Merge branch 'master' into use-dag-in-key-condition 2022-07-25 14:30:22 +02:00
Igor Nikonov
572dd864fe Merge remote-tracking branch 'origin/master' into skipping_sorting_step 2022-07-25 12:19:14 +00:00
Igor Nikonov
dc96a6270d Remove optimize_memory_usage flag
Memory usage with DistinctSortedTransform fixed in #39538
2022-07-25 10:27:33 +00:00
Alexander Gololobov
460950ecdc
Merge branch 'master' into feature/sql-standard-delete 2022-07-24 21:27:22 +02:00
Igor Nikonov
329adc3419
Merge branch 'master' into distinct_sorted_chunk_perf_impr 2022-07-22 12:58:59 +02:00
Igor Nikonov
51f63c3a0c Add setting optimize_distinct_in_order_memory_usage 2022-07-22 10:57:57 +00:00
Igor Nikonov
7db5d54820 Adopt to the case when not all columns in distinct are part of sorting
description
2022-07-21 21:04:58 +00:00
Igor Nikonov
122a1123b2 - disable the worst case for distinct in order in perf test for now
+ functional test for query with the worst perfomance
+ debug logging in DistinctStep
2022-07-21 15:03:19 +00:00
Alexander Gololobov
1ea9f143ff Leave only _row_exists-based implementation of lightweight delete 2022-07-21 11:26:13 +02:00
Igor Nikonov
635a566bec Comment change 2022-07-20 21:37:46 +00:00
Igor Nikonov
e50aebb5f0
Merge branch 'master' into distinct_sorted_chunk_perf_impr 2022-07-20 23:17:11 +02:00
Igor Nikonov
965f96bd84 DISTINCT in order: perf improvement
+ reduce allocations in DistinctSortedChunkTransform
+ use it for final distinct as well
2022-07-20 20:44:47 +00:00
Nikolai Kochetov
91043351aa Fixing build. 2022-07-20 20:30:16 +00:00
Nikolai Kochetov
4e8cd70b1d
Merge branch 'master' into use-dag-in-key-condition 2022-07-20 17:38:33 +02:00
Nikolai Kochetov
f570cde815 Fixing build. 2022-07-19 20:19:57 +00:00
Igor Nikonov
1fe83cc8d8 optimize_sorting_for_input_stream setting and perf tests 2022-07-19 16:58:15 +00:00
Nikolai Kochetov
eaeb30a71a Merge branch 'master' into use-dag-in-key-condition 2022-07-19 18:39:52 +02:00
Dmitry Novik
50989bdb68
Merge branch 'master' into group-by-use-nulls 2022-07-19 14:58:01 +02:00
Alexander Gololobov
9de72d995a POC lightweight delete using __row_exists virtual column and prewhere-like filtering 2022-07-18 20:06:42 +02:00
Igor Nikonov
e607d103cc Just to trigger CI 2022-07-15 23:16:02 +00:00
Igor Nikonov
6f224b026a Perf test. Code polishing 2022-07-15 21:54:57 +00:00
Igor Nikonov
d9b312f955 Self-review + revert test 2022-07-15 17:00:25 +00:00
Igor Nikonov
a3a1ccc520 Fix: SortMode::Chunk 2022-07-15 10:26:13 +00:00
jianmei zhang
9d27af7ee2 For some columns mutations, skip to apply deleted mask when read some columns. Also add unit test case 2022-07-15 12:32:41 +08:00
Igor Nikonov
8170f4e33a
Merge branch 'master' into skipping_sorting_step 2022-07-14 23:05:45 +02:00
Igor Nikonov
1efdb4e3e5 Disable finish sort with sorted chunks 2022-07-14 21:02:44 +00:00
Igor Nikonov
7cd12393c2 If sorting type is specified then use it. Otherwise rely on sort description 2022-07-14 16:26:25 +00:00
Igor Nikonov
1d49adad20 Introduce Auto mode for sorting step (replace others for now) 2022-07-14 13:29:39 +00:00
Igor Nikonov
b73aca2a3b
Merge branch 'master' into skipping_sorting_step 2022-07-13 19:06:41 +02:00
Igor Nikonov
159c9428bd clean up 2022-07-13 17:05:54 +00:00
Igor Nikonov
f0d547993a Fix: 01655_plan_optimizations_optimize_read_in_window_order_long
basically I returned code. Both plans with Finish sorting, need to check
sorting prefix
2022-07-13 16:51:51 +00:00
vdimir
4124dc9ac4
Rewrite tryPushDownFilter for join with lambda 2022-07-13 12:06:29 +00:00
vdimir
549a85fee9
Throw logical error on child idx mismatch in tryAddNewFilterStep 2022-07-13 11:53:46 +00:00
vdimir
bddf6c1b32
Pushdown filter to the right side of sorting join 2022-07-13 11:36:25 +00:00
Igor Nikonov
1d6f699a12 Use sort mode Port for reading in order 2022-07-12 21:56:00 +00:00
Amos Bird
982e1a73d3
Better 2022-07-12 22:21:46 +08:00
Amos Bird
d3709c6c26
Avoid redundant join block transformation. 2022-07-12 22:20:10 +08:00
Amos Bird
b9d9ca5194
style fix 2022-07-12 22:20:08 +08:00
Dmitry Novik
aabf5123d6 Fixup 2022-07-12 13:46:06 +00:00
Igor Nikonov
2c8d9080bd Fix: consider collation in column sort description comparison 2022-07-12 13:14:10 +00:00
Dmitry Novik
cfca3db884 Fix crash with totals 2022-07-12 12:15:43 +00:00
Igor Nikonov
ea5e7793b2 Fix: self-review comments 2022-07-11 21:26:39 +00:00
Igor Nikonov
e0776b1c82 Fix: test for optimize read in window order
+ code polishing
2022-07-11 20:59:38 +00:00
Igor Nikonov
0ca8166ab2 Fix: forgot to return sorting type in constructors 2022-07-11 20:59:38 +00:00
Igor Nikonov
47bed7e318 Try to choose sorting transform based on sort description with fallback 2022-07-11 20:59:38 +00:00
Igor Nikonov
2a7e3bd741 Fix + SortMode::None as default value 2022-07-11 20:59:38 +00:00
Igor Nikonov
16d2319a8d SortingStep: type of sorting is deduced based on input stream sorting description in during transformation
+ perf test
2022-07-11 20:59:38 +00:00
Igor Nikonov
7d4d92bd61 In case full sort was wrong choise during plan interpretation 2022-07-11 20:59:38 +00:00
Igor Nikonov
67ce421e38 Skip sorting step if input stream is globally sorted 2022-07-11 20:59:38 +00:00
Dmitry Novik
d1df66687b
Merge branch 'master' into group-by-use-nulls 2022-07-07 20:54:38 +02:00
Dmitry Novik
1587385f7a Cleanup code 2022-07-07 18:53:20 +00:00
vdimir
7c586a9e7c
Minor updates for full soring merge join 2022-07-06 14:28:05 +00:00
vdimir
1b429fc1af
wip: any left/right sorting join 2022-07-06 14:23:46 +00:00
vdimir
8dce97123c
wip: any inner full sorting join 2022-07-06 14:23:46 +00:00
vdimir
4a16195964
Calculate output header for full sorting merge join 2022-07-06 14:23:45 +00:00
vdimir
fa8eb35599
Pipeline for full sorting merge join 2022-07-06 14:23:44 +00:00
Maksim Kita
b94489d52c
Merge pull request #38859 from kitaisreal/merge-tree-merge-disable-batch-optimization
MergeTree merge disable batch optimization
2022-07-06 15:59:40 +02:00
Maksim Kita
bdc21737d5 MergeTree merge disable batch optimization 2022-07-05 16:15:00 +02:00
Igor Nikonov
9ef8ff5a31 Addressing review comments 2022-07-01 22:50:00 +00:00
Anton Popov
ef87e1207c better support of read_in_order in case of fixed prefix of sorting key 2022-07-01 16:45:01 +00:00
Dmitry Novik
81dd90893e Merge remote-tracking branch 'origin/master' into group-by-use-nulls 2022-07-01 16:24:05 +00:00