Commit Graph

9915 Commits

Author SHA1 Message Date
Raúl Marín
473743b49f
Disable pure parallel replicas if trivial count optimization is possible (#50594) 2023-06-06 18:38:32 +02:00
Nikita Mikhaylov
e87348010d
Rework loading and removing of data parts for MergeTree tables. (#49474)
Co-authored-by: Sergei Trifonov <sergei@clickhouse.com>
2023-06-06 14:42:56 +02:00
Kseniia Sumarokova
175515b9ec
Merge pull request #50583 from kssenii/fix-logical-error-in-try-reserve-2
Fix logical error in stress test (Not enough space to add ...)
2023-06-06 12:14:46 +02:00
Michael Kolupaev
9f80900d6f Changes related to an internal feature 2023-06-05 18:20:38 -07:00
Kseniia Sumarokova
0832cb2d7a
Update Metadata.h 2023-06-05 17:51:12 +02:00
Kseniia Sumarokova
2b3db1d33c
Update Metadata.cpp 2023-06-05 17:05:06 +02:00
kssenii
58932b81cc Merge remote-tracking branch 'upstream/master' into fix-logical-error-in-try-reserve-2 2023-06-05 13:07:12 +02:00
kssenii
f3a8517a44 Fix 2023-06-05 13:07:07 +02:00
Alexey Milovidov
4b1bb75a07
Merge pull request #50383 from bigo-sg/grace_hash_join_mismatch_right_block
Without applying `prepareRightBlock` will cause mismatch block structrue
2023-06-05 05:57:16 +03:00
kssenii
009fe3d25e Add profile events for eviction 2023-06-03 21:35:27 +02:00
Alexey Milovidov
9e938d7eec
Merge pull request #49287 from nickitat/optimize_reading2
Optimise hot reading from remote tables
2023-06-02 23:51:57 +03:00
vdimir
b1f58d765a
Merge pull request #48633 from ClickHouse/vdimir/any_join_single_row 2023-06-02 15:05:13 +02:00
Nikita Mikhaylov
73db383727
Limit the number of in-flight tasks for loading outdated parts (#50450)
* Done

* Update programs/local/LocalServer.cpp

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>

* Bump

---------

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
2023-06-02 14:10:26 +02:00
vdimir
bdb192cf27
Test right join in 02725_any_join_single_row, style code changes 2023-06-01 15:43:37 +00:00
vdimir
62f950ddaf
Keep blocks with nulls for right and full join 2023-06-01 12:03:10 +00:00
vdimir
68d46c81b9
Do not store blocks in hash join if nothing is inseted 2023-06-01 12:03:09 +00:00
Zhiguo Zhou
3d0f336643 Optimize predicate with toYYYYMM converter
Like toYear(PR #50062), the predicate with toYYYYMM could also be
optimized with its preimage. For example, we could transform the
predicate "toYYYYMM(c) = 202305" to "c >= '2023-05-01' AND c <=
'2023-05-31'", so that the invocation of toYYYYMM is avoided. The
similar transformation also applies to other comparisons.

This commit extends OptimizeDateFilterInPlaceVisitor by having it
recognize the toYYYYMM converter in the WHERE/PREWHERE clauses and
replace it with the above tranformed predicate in-place at the AST
level.
2023-06-01 10:20:45 +08:00
lgbo-ustc
5dbce62ec3 fixed. without apply prepareRightBlock will cause mismatch block structure 2023-06-01 08:10:28 +08:00
Nikita Mikhaylov
3543d95980
Parallel replicas always skip unavailable ones (#50293) 2023-05-31 22:10:33 +02:00
kssenii
f15769ee6c Fix 2023-05-30 21:29:08 +02:00
Sema Checherinda
84d6bfe5f6
Merge pull request #50204 from azat/InsertSelectQueries-pe
Add new profile events for queries with subqueries
2023-05-30 15:19:04 +02:00
Antonio Andelic
bb2acb50d2
Merge pull request #50186 from LiuYangkuan/support_fqdn_in_cluster_discovery
support passing fqdn to register cluster node in keeper
2023-05-30 11:54:09 +02:00
SmitaRKulkarni
f2172ab8dd
Merge pull request #46661 from ClickHouse/42192_Lower_parallel_parsing_threads_with_globs
When reading from multiple files displace parallel parsing
2023-05-30 08:53:08 +02:00
Nikita Taranov
a3652f1727 Merge branch 'master' into optimize_reading2 2023-05-29 15:26:18 +02:00
Robert Schulze
47daaad172
Merge pull request #49778 from helifu/master2
Support custom 'order by' expression for system log tables
2023-05-29 10:05:14 +02:00
Alexey Milovidov
9647cfa33d
Merge pull request #50291 from kitaisreal/jit-aggregation-nullable-key-fix
JIT aggregation nullable key fix
2023-05-29 02:08:02 +03:00
alesapin
3a3cee586a
Merge pull request #50257 from CurtizJ/useless-refactoring
Yet another refactoring
2023-05-28 21:42:16 +02:00
Maksim Kita
e9840bc6e1 JIT aggregation nullable key fix 2023-05-28 21:05:17 +03:00
Nikita Taranov
42a9072888 Merge branch 'master' into optimize_reading2 2023-05-28 18:04:44 +02:00
helifu
6e8136e6f4 Add 'settings' expression for system log tables 2023-05-28 12:59:34 +08:00
helifu
59a815e4e6 Update according to review comments 2023-05-28 12:59:34 +08:00
helifu
57e5a4aa63 Add the 'order_by' description for system log tables 2023-05-28 12:59:34 +08:00
helifu
03e11b6e16 Remove the duplicate pair of parentheses 2023-05-28 12:59:34 +08:00
helifu
90a6437716 Support custom 'order by' expression for system log tables 2023-05-28 12:59:34 +08:00
Azat Khuzhin
6b5933a3db Add new profile events for queries with subqueries
Differs from SelectQuery/InsertQuery that it could be > 1 (in case of
MATERIALIZED VIEW attached to the table), since each local SELECT/INSERT
query is accounted, not only initial.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-05-26 18:28:40 +02:00
Sergei Trifonov
0d1f2e297b
Unify priorities: lower value means higher priority (#50205) 2023-05-26 15:55:30 +02:00
Anton Popov
f9c7fcbe0a
Merge branch 'master' into useless-refactoring 2023-05-26 13:45:58 +02:00
Raúl Marín
b3a96de533
Pure parallel replicas: JOIN support (#49544) 2023-05-26 01:04:24 +02:00
Anton Popov
612173e734 refactoring near alter conversions 2023-05-25 22:54:54 +00:00
Kseniia Sumarokova
f1a3c9cfd5
Merge pull request #50109 from kssenii/abstract-async-prefetched-buffer
Make async prefetched buffer work with arbitrary impl
2023-05-25 15:06:44 +02:00
Nikita Mikhaylov
1c3b6738f4
Fixes for parallel replicas (#50195) 2023-05-25 14:41:04 +02:00
Han Fei
55c2dbcc2d
Merge pull request #50062 from ZhiguoZh/20230511-toyear
Optimize predicate with toYear converter
2023-05-25 13:25:55 +02:00
vdimir
2df4130d82
Update src/Interpreters/ClusterDiscovery.cpp 2023-05-25 13:06:40 +02:00
Sema Checherinda
23f894b995
Merge pull request #49777 from helifu/master1
Add 'initial_query_id' field for system.processors_profile_log
2023-05-25 12:55:32 +02:00
Sema Checherinda
3329a8428d
Merge pull request #49779 from helifu/master3
Add 'partitions' field for system.query_log
2023-05-25 12:51:40 +02:00
Igor Nikonov
1c0b02c3c4
Merge pull request #49503 from ClickHouse/fill_with_by_sorting_prefix_2
WITH FILL by sorting prefix
2023-05-25 12:37:40 +02:00
何李夫
e4c8c4cecf
Add zookeeper name in endpoint id (#49780)
* Add zookeeper name in endpoint id

When we migrate a replicated table from one zookeeper cluster to
another (the reason why we migration is that zookeeper's load is
too high), we will create a new table with the same zpath, but it
will fail and the old table will be in trouble.

Here is some infomation:
1.old table:
  CREATE TABLE a1 (`id` UInt64)
  ENGINE = ReplicatedMergeTree('/clickhouse/tables/default/a1/{shard}', '{replica}')
  ORDER BY (id);
2.new table:
  CREATE TABLE a2 (`id` UInt64)
  ENGINE = ReplicatedMergeTree('aux1:/clickhouse/tables/default/a1/{shard}', '{replica}')
  ORDER BY (id);
3.error info:
  <Error> executeQuery: Code: 220. DB::Exception: Duplicate interserver IO endpoint:
          DataPartsExchange:/clickhouse/tables/default/a1/01/replicas/02.
          (DUPLICATE_INTERSERVER_IO_ENDPOINT)
  <Error> InterserverIOHTTPHandler: Code: 221. DB::Exception: No interserver IO endpoint
          named DataPartsExchange:/clickhouse/tables/default/a1/01/replicas/02.
          (NO_SUCH_INTERSERVER_IO_ENDPOINT)

* Revert "Add zookeeper name in endpoint id"

This reverts commit 9deb75b249619b7abdd38e3949ca8b3a76c9df8e.

* Add zookeeper name in endpoint id

When we migrate a replicated table from one zookeeper cluster to
another (the reason why we migration is that zookeeper's load is
too high), we will create a new table with the same zpath, but it
will fail and the old table will be in trouble.

* Fix incompatible with a new setting

* add a test, fix other issues

* Update 02442_auxiliary_zookeeper_endpoint_id.sql

* Update 02735_system_zookeeper_connection.reference

* Update 02735_system_zookeeper_connection.sql

* Update run.sh

* Remove the 'no-fasttest' tag

* Update 02442_auxiliary_zookeeper_endpoint_id.sql

---------

Co-authored-by: Alexander Tokmakov <tavplubix@clickhouse.com>
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-05-25 12:50:14 +03:00
Zhiguo Zhou
1bc4eb1a6c OptimizeDateFilterVisitor: Revise variable names for clarity 2023-05-25 13:47:03 +08:00
helifu
802b63f2ab Add 'initial_query_id' field for system.processors_profile_log
Facilitate profile data association and aggregation for the same query
2023-05-25 09:37:02 +08:00
Zhiguo Zhou
773a5bbbaa Optimize predicate with toYear converter
The date converters, such as toYear, are widely used in the where
clauses of the SQL queries, however, these conversions are often
expensive due to the complexity of the calendar system.

The function preimage is found an optimization for the predicates
with the converters. Given a predicate, toYear(c) = y, we could
convert it to its equivalent form: c >= b AND c <= e, where b is
"y-01-01" and e is "y-12-31". The similar transformation applies
to other comparisons (<>, <, >, <=, <=).

This commit implemented the above transformation at the AST level
by adding a new pass in the TreeOptimizer and a new AST visitor
for in-place replacing the predicates of toYear with the converted
ones.
2023-05-25 09:11:51 +08:00