Commit Graph

178 Commits

Author SHA1 Message Date
Nikolai Kochetov
21bd45fb22
Update InterpreterSelectQuery.cpp 2020-09-17 12:57:48 +03:00
roman
b41421cb1c [settings]: introduce new query complexity settings for leaf-nodes
The new setting should allow to control query complexity on leaf nodes
excluding the final merging stage on the root-node. For example, distributed
query that reads 1k rows from 5 shards will breach the `max_rows_to_read=5000`,
while effectively every shard reads only 1k rows. With setting `max_rows_to_read_leaf=1500`
this limit won't be reached and query will succeed since every shard reads
not more that ~1k rows.
2020-09-17 10:37:05 +01:00
Nikolai Kochetov
e29f27e333
Merge pull request #14815 from ClickHouse/storage-read-query-plan
Return query plan from storage.
2020-09-15 18:34:11 +03:00
Nikolai Kochetov
6eac433c55 Review fixes. 2020-09-15 13:40:39 +03:00
Artem Zuikov
51ba12c2c3
Try speedup build (#14809) 2020-09-15 12:55:57 +03:00
Nikolai Kochetov
bcfc83022a Return query plan from storage. 2020-09-14 17:13:58 +03:00
alexey-milovidov
f2e9a09b11
Merge pull request #14585 from ClickHouse/join-processor
Remove Join from ExpressionActions
2020-09-08 23:56:09 +03:00
Nikolai Kochetov
39aad9979a Remove Join from ExpressionActions. 2020-09-08 13:40:53 +03:00
Nikolai Kochetov
c761970bc5 Merge branch 'master' into pipes-and-creating-sets 2020-09-04 11:38:35 +03:00
Nikolai Kochetov
b7e53208d1 Fix tests. 2020-09-04 11:36:47 +03:00
Azat Khuzhin
10b4f3b41f Optimize queries with LIMIT/LIMIT BY/ORDER BY for distributed with GROUP BY sharding_key
Previous set of QueryProcessingStage does not allow to do this.
But after WithMergeableStateAfterAggregation had been introduced the
following queries can be optimized too under
optimize_distributed_group_by_sharding_key:
- GROUP BY sharding_key LIMIT
- GROUP BY sharding_key LIMIT BY
- GROUP BY sharding_key ORDER BY

And right now it is still not supports:
- WITH TOTALS (looks like it can be supported)
- WITH ROLLUP (looks like it can be supported)
- WITH CUBE
- SETTINGS extremes=1 (looks like it can be supported)
But will be implemented separatelly.

vX: fixes
v2: fix WITH *
v3: fix extremes
v4: fix LIMIT OFFSET (and make a little bit cleaner)
v5: fix HAVING
v6: fix ORDER BY
v7: rebase against 20.7
v8: move out WithMergeableStateAfterAggregation
v9: add optimize_distributed_group_by_sharding_key into test names
2020-09-03 00:52:51 +03:00
Azat Khuzhin
4043be3121 Add new query processing stage WithMergeableStateAfterAggregation
Process query until the stage where the aggregate functions were
calculated and finalized.

It will be used for optimize_distributed_group_by_sharding_key.

v2: fix aliases
v3: Fix protocol ABI breakage due to WithMergeableStateAfterAggregation
    Conditions >= for QueryProcessingStage::Enum has been verified, and they
    are ok (in InterpreterSelectQuery).
2020-09-03 00:51:08 +03:00
Nikolai Kochetov
acfd35a908 Update QueryPipeline::addCreatingSetsTransform 2020-09-02 16:04:54 +03:00
Nikolai Kochetov
95bbda3667 Specify columns after ARRAY JOIN and JOIN.
Add ArrayJoinTransform and ArrayJoinStep.
2020-08-14 21:24:03 +03:00
Vitaly Baranov
cd372de417 Use SettingUInt64 only in Settings, use UInt64 in other places. 2020-07-31 19:11:27 +03:00
Nikolai Kochetov
be24184deb Ignore constants for remote query from local replica. 2020-07-29 17:27:37 +03:00
Artem Zuikov
2afd123eda
Refactoring: extract TreeOptimizer from SyntaxAnalyzer (#12645) 2020-07-22 20:13:05 +03:00
Alexey Milovidov
ef930df484 Avoid overflow in LIMIT #10470 #11372 2020-07-12 08:18:01 +03:00
Nikolai Kochetov
8587c2025d Merge branch 'master' into initial-explain 2020-06-29 23:35:56 +03:00
Nikolai Kochetov
40b398c8c4 Merge branch 'master' into better-distinct-for-query-plan 2020-06-29 11:14:05 +03:00
Nikolai Kochetov
893a75bcf7 Merge branch 'master' into initial-explain 2020-06-27 12:45:40 +03:00
Nikolai Kochetov
ca01094f4b More actions description. 2020-06-27 12:31:11 +03:00
Nikolai Kochetov
e1481ccfc2 Add initial explain. 2020-06-27 12:30:38 +03:00
Artem Zuikov
54fd9ce76b fix totals 2020-06-26 03:23:11 +03:00
Artem Zuikov
2d7d389b77 better ExpressionAction::execute() 2020-06-25 23:28:41 +03:00
Artem Zuikov
ae5ed098f4 remove useless logic 2020-06-25 21:18:27 +03:00
Artem Zuikov
801efc387a extract JOIN in own plan step 2020-06-25 20:40:25 +03:00
Nikolai Kochetov
58b3b5c2f9 Rename step. 2020-06-22 13:21:13 +03:00
Nikolai Kochetov
d7d334bf6f Update query plan traits for DISTINCT. Add more comments. 2020-06-22 13:18:28 +03:00
alesapin
b1e8976df4 Merge with master 2020-06-22 12:04:27 +03:00
alesapin
b9e74f4e82 Merge branch 'master' into atomic_metadata5 2020-06-22 12:03:53 +03:00
Nikolai Kochetov
819ea4fb89 Fix tests. 2020-06-20 16:48:21 +03:00
Nikolai Kochetov
0c6129ac7c Fix build. 2020-06-20 11:52:41 +03:00
Nikolai Kochetov
4d70cc34c1 Merge branch 'master' into query-plan 2020-06-20 10:53:48 +03:00
alexey-milovidov
4129300fdb
Merge pull request #11788 from ClickHouse/fix-too-many-threads
Fix too many threads
2020-06-20 08:24:47 +03:00
alesapin
85070ea2fd Remove unused variable 2020-06-19 22:41:24 +03:00
alesapin
4c0879ae30 Better logging in storages 2020-06-19 20:17:13 +03:00
Nikolai Kochetov
9ca456f255 Try fix totals. 2020-06-19 19:58:27 +03:00
Nikolai Kochetov
4cafa3d703 Try fix totals. 2020-06-19 19:51:44 +03:00
Nikolai Kochetov
f6cd3f43bb Fix Context leak in InterpreterSelectQuery 2020-06-19 17:42:01 +03:00
Nikolai Kochetov
6c9c33f870 Fix Context leak in InterpreterSelectQuery 2020-06-19 17:00:11 +03:00
Nikolai Kochetov
ec892775a5 Fix Context leak in InterpreterSelectQuery 2020-06-19 16:34:40 +03:00
alexey-milovidov
3e06182079
Update InterpreterSelectQuery.cpp 2020-06-19 14:28:48 +03:00
Nikolai Kochetov
0335c698e0 Limit the number of threads. 2020-06-19 13:57:44 +03:00
Nikolai Kochetov
9ddd7b98cc Fix tests. 2020-06-19 12:47:15 +03:00
Nikolai Kochetov
6708ae75f3 Fix build. 2020-06-19 11:30:21 +03:00
Nikolai Kochetov
cda4de40d7 Merge branch 'master' into query-plan 2020-06-19 11:29:15 +03:00
Nikolai Kochetov
a99d9f7712 Fix build. 2020-06-18 21:36:37 +03:00
Nikolai Kochetov
b7bed87a7f Use QueryPlan in InterpreterSelectQuery [part 3]. 2020-06-18 21:29:33 +03:00
Nikolai Kochetov
45adacf0bc Use QueryPlan in InterpreterSelectQuery [part 2]. 2020-06-18 20:45:00 +03:00