Commit Graph

265 Commits

Author SHA1 Message Date
Nikolai Kochetov
c91b453630 Try fix tests. 2020-10-22 14:08:12 +03:00
Nikolai Kochetov
7fa045cff8 Merge branch 'master' into storage-read-query-plan 2020-10-22 13:31:10 +03:00
alexey-milovidov
adeba6bdd8
Merge pull request #15074 from amosbird/btc
Extend trivial count optimization.
2020-10-22 02:50:57 +03:00
alexey-milovidov
be7776608d
Merge pull request #15933 from ClickHouse/fix-global-in-result
Fix wrong result in case of GLOBAL IN and PREWHERE
2020-10-19 21:21:57 +03:00
Alexander Tokmakov
7d58992ea8 fix select count() 2020-10-14 16:15:15 +03:00
Nikolai Kochetov
534b60e242 Fix build. 2020-10-13 18:10:30 +03:00
Nikolai Kochetov
23afd74e1c Update InterpreterSelectQuery. 2020-10-13 17:55:22 +03:00
Nikolai Kochetov
1af0792f67 Update InterpreterSelectQuery. 2020-10-13 17:33:34 +03:00
Nikolai Kochetov
2bbdfc77ea Update creating sets. 2020-10-13 16:48:00 +03:00
Nikolai Kochetov
337098367b Try fix perf 2020-10-13 11:36:15 +03:00
Nikolai Kochetov
7e58f99f64 Merge branch 'master' into storage-read-query-plan 2020-10-12 13:12:39 +03:00
Amos Bird
867216103f
Extend trivial count optimization. 2020-10-08 18:08:17 +08:00
Amos Bird
c9ab87ed17
Fix explain syntax 2020-10-08 17:06:04 +08:00
Amos Bird
ac102540d0
Global WITH and WITH propagation. 2020-10-08 15:03:34 +08:00
Nikolai Kochetov
f9bf1e3406 Merge branch 'master' into storage-read-query-plan 2020-10-06 09:50:10 +03:00
Azat Khuzhin
587cde853e Avoid skipping unused shards twice (for query processing stage and read itself) 2020-10-02 22:42:09 +03:00
Nikolai Kochetov
bef96faa1a Tru fix tests. 2020-10-02 15:38:33 +03:00
hchen9
68888408da Pass context ptr to ref 2020-10-01 21:23:41 -07:00
hchen9
b3949db00f Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into trivial_count_seq_consistency 2020-10-01 21:15:26 -07:00
hchen9
b4494578d7 Support select_sequential_consistency in StorageReplicatedMergeTree.totalRows and totalBytes 2020-09-30 16:50:58 -07:00
hchen9
a5ac39b564 Pass Context parameter for IStorage.totalRows and IStorage.totalBytes 2020-09-30 16:47:42 -07:00
Artem Zuikov
0f6a6453fe
Remove multiple_joins_rewriter v1 (#15472) 2020-09-30 23:11:49 +03:00
Nikolai Kochetov
576ffadb17 Fix explain for ISourceStep. 2020-09-30 15:22:30 +03:00
hchen9
fda6bde428 improve change 2020-09-28 17:05:22 -07:00
Nikolai Kochetov
dea90009e3 Fix build 2020-09-25 16:03:12 +03:00
Nikolai Kochetov
62ef40394a
Merge pull request #14856 from ClickHouse/query-plan-for-creating-sets
Query plan for creating sets
2020-09-22 16:19:20 +03:00
Nikolai Kochetov
54c1f04b38 Review fixes. 2020-09-21 11:36:12 +03:00
Alexey Milovidov
059646743b Remove OpenCL 2020-09-19 17:20:00 +03:00
alexey-milovidov
acbdc51460
Merge pull request #14771 from amosbird/withsub
First attempt of supporting CTE
2020-09-19 16:25:34 +03:00
Artem Zuikov
28afbafa08 fix crash in RIGHT or FULL JOIN switch 2020-09-18 19:25:20 +03:00
Nikolai Kochetov
b26f11c00c Support StorageDistributed::read for QueryPlan. 2020-09-18 17:16:53 +03:00
Nikolai Kochetov
2ffc2b6927 Refactor IStorage::read with query plan. 2020-09-18 15:10:59 +03:00
Nikolai Kochetov
50674a320f Refactor IStorage::read with query plan. 2020-09-18 14:39:07 +03:00
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
3cc89d467c Merge branch 'master' into query-plan-for-creating-sets 2020-09-15 20:15:41 +03:00
Nikolai Kochetov
118a8a513e Update mutations interpreter. 2020-09-15 20:13:13 +03: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
4c783f19ee Use QueryPlan for SubqueryForSet. 2020-09-15 16:25:14 +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
Amos Bird
882b2a3348
CTE 2020-09-13 09:39:17 +08: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
Amos Bird
d524301038
add scalars in time 2020-06-19 00:14:19 +08:00
alesapin
d79982f497 Better locks in Storages 2020-06-18 19:10:47 +03:00
Nikolai Kochetov
e0841360db Use QueryPlan in InterpreterSelectQuery [part 1]. 2020-06-18 16:38:45 +03:00
Nikolai Kochetov
5bb2ddc6f9 Add DISTINCT trait for QueryPlanStep. 2020-06-18 16:00:16 +03:00
Nikolai Kochetov
9ad00187e3 Update InterpreterSelectQuery.. 2020-06-17 23:19:55 +03:00
Nikolai Kochetov
169ad5e805 Add FinishSortingStep. 2020-06-17 22:57:13 +03:00
Nikolai Kochetov
e8049d34c5 Add OffsetsStep. 2020-06-17 22:38:45 +03:00
Nikolai Kochetov
69ff3a8f7d Add ExtremesStep. 2020-06-17 22:30:36 +03:00
Nikolai Kochetov
d795b2b037 Add FillingStep 2020-06-17 22:20:30 +03:00
Nikolai Kochetov
84fd7fe51c Update having. 2020-06-17 22:02:46 +03:00
Nikolai Kochetov
2cffa56914 Add RollupStep and CubeStep. 2020-06-17 20:20:09 +03:00
Nikolai Kochetov
d41db3622f Add RollupStep and CubeStep. 2020-06-17 20:15:24 +03:00
alesapin
51a47560e0 Fix segmentation fault 2020-06-17 19:59:26 +03:00