Commit Graph

1078 Commits

Author SHA1 Message Date
alesapin
be106b662e Comment and style 2020-07-21 18:19:41 +03:00
alesapin
daaa5cc382 Add setting allow_non_metadata_alters 2020-07-21 17:05:30 +03:00
alesapin
379a5a750a Fix error message about granularity 2020-07-21 14:10:23 +03:00
Alexander Kuzmenkov
40ee6eba19
Merge pull request #12545 from ClickHouse/fix_load_part_without_checksums
Fix loading parts without checksums
2020-07-20 14:40:53 +03:00
tavplubix
5634482393
Merge pull request #12556 from azat/distributed-remove-files-on-drop
Remove data for Distributed tables (blocks from async INSERTs) on DROP TABLE
2020-07-17 19:29:57 +03:00
alexey-milovidov
9fb40a3f7b
Merge pull request #12386 from fastio/master
COS (Tencent Cloud Object Storage) integration
2020-07-17 14:09:16 +03:00
alesapin
ac802a8e96
Merge pull request #12543 from ClickHouse/fix_marks_type_on_mutation
Fix incorrect adaptive granularity by default
2020-07-17 11:09:54 +03:00
Azat Khuzhin
6ea1b19476 Remove data for Distributed tables (blocks from async INSERTs) on DROP TABLE 2020-07-17 08:59:57 +03:00
alexey-milovidov
fde8c87a1f
Merge pull request #12426 from ClickHouse/log-engine-rollback-on-insert-error
Rollback insertion error in Log engines
2020-07-16 22:50:48 +03:00
Anton Popov
97e8a88b30
Merge pull request #12277 from bobrik/ivan/exact-range-speedup
WIP: Optimize PK lookup for queries that match exact PK range
2020-07-16 19:17:50 +03:00
alesapin
b3ec3b1ed1 Fix loading parts without checksums 2020-07-16 13:54:49 +03:00
Vitaly Baranov
000b197ad1
Merge pull request #11234 from traceon/ldap-per-user-authentication
Add LDAP authentication support
2020-07-16 13:17:21 +03:00
alesapin
42983c5416 Fix incorrect adaptive granularity by default 2020-07-16 12:10:15 +03:00
Alexey Milovidov
6df282e813 Fixup 2020-07-16 11:33:51 +03:00
alexey-milovidov
8966c09ed6
Merge pull request #12519 from vzakaznikov/fix_data_duplication_and_tests_for_live_view
Fixing race condition in live view tables which could cause data duplication and live view tests
2020-07-16 11:03:28 +03:00
Alexey Milovidov
68f9fd3767 Debug tests 2020-07-16 06:02:20 +03:00
Alexey Milovidov
82ea884d01 Fix incorrect unit test 2020-07-16 05:37:12 +03:00
Alexey Milovidov
3408b7e259 Merge branch 'master' into log-engine-rollback-on-insert-error 2020-07-16 05:34:02 +03:00
Denis Glazachev
59cb758cf7 Merge branch 'master' into ldap-per-user-authentication 2020-07-16 02:29:24 +04:00
Alexey Milovidov
e1e2204279 Whitespace 2020-07-15 19:37:52 +03:00
Vitaliy Zakaznikov
370dd3396b Fixing clang build. 2020-07-15 16:18:53 +02:00
Vitaliy Zakaznikov
560151f6cd * Fix bug in StorageLiveView.cpp
* Fixing synchronization of the first insert in live view tests
2020-07-15 13:24:33 +02:00
alesapin
614540eddf
Merge pull request #12382 from ClickHouse/clear-all-columns
Better errors for CLEAR/DROP columns (possibly in partitions)
2020-07-15 12:52:06 +03:00
alexey-milovidov
9c68124110
Merge pull request #12302 from azat/kafka-error-in-the-batch-SIGSEGV
kafka: fix SIGSEGV if there is a message with error in the middle of the batch
2020-07-15 05:20:26 +03:00
alesapin
9e41fbca55 Remove check for drop detached partition 2020-07-14 16:56:30 +03:00
Alexander Kuzmenkov
b515dd5b83 Merge remote-tracking branch 'origin/master' into HEAD 2020-07-14 15:40:27 +03:00
Alexander Kuzmenkov
b24f727aea typo 2020-07-14 15:40:18 +03:00
alesapin
014bb070ec Fix tests 2020-07-14 11:19:39 +03:00
alexey-milovidov
fd4adf27d6
Merge pull request #12456 from CurtizJ/fix-12437
Fix #12437
2020-07-14 09:28:31 +03:00
alexey-milovidov
1893d89ce3
Merge pull request #12448 from ClickHouse/fix-trash-rabbitmq
Fix trash from RabbitMQ
2020-07-14 01:11:37 +03:00
alesapin
1f576ee039 Some intermediate solution 2020-07-13 20:27:52 +03:00
Alexey Milovidov
cb46bca157 Merge branch 'master' into fix-trash-rabbitmq 2020-07-13 19:51:17 +03:00
alesapin
4a53264a86 Remove redundant and duplicated code 2020-07-13 19:19:08 +03:00
robot-clickhouse
0f23642a3d Auto version update to [20.7.1.1] [54437] 2020-07-13 18:26:03 +03:00
Peng Jian
7579d65ebc Registering StorageS3 and TableFunctionS3 under two different names (S3 and COSN). 2020-07-13 22:13:30 +08:00
Alexander Kuzmenkov
d6e7ab5988 Fuzzing-related fixes 2020-07-13 16:58:48 +03:00
Denis Glazachev
f787702922 Merge branch 'master' into ldap-per-user-authentication
* master: (27 commits)
  Whitespaces
  Fix typo
  Fix UBSan report in base64
  Correct default secure port for clickhouse-benchmark #11044
  Remove test with bug #10697
  Update in-functions.md (#12430)
  Allow nullable key in MergeTree
  Update arithmetic-functions.md
  [docs] add rabbitmq docs (#12326)
  Lower block sizes and look what will happen #9248
  Fix lifetime_bytes/lifetime_rows for Buffer direct block write
  Retrigger CI
  Fix up  test_mysql_protocol failed
  Implement lifetime_rows/lifetime_bytes for Buffer engine
  Add comment regarding proxy tunnel usage in PocoHTTPClient.cpp
  Add lifetime_rows/lifetime_bytes interface (exported via system.tables)
  Tiny IStorage refactoring
  Trigger integration-test-runner image rebuild.
  Delete log.txt
  Fix test_mysql_client/test_python_client error
  ...
2020-07-13 15:46:27 +04:00
Anton Popov
a9530d2883 in-memory parts: fix reading from nested 2020-07-13 12:10:55 +03:00
alexey-milovidov
ae7eff98ed
Merge pull request #12433 from amosbird/np
Allow nullable key in MergeTree
2020-07-13 04:36:00 +03:00
Alexey Milovidov
8f2055b0a0 Fix trash from RabbitMQ 2020-07-13 04:11:48 +03:00
Amos Bird
cac5a89169
Allow nullable key in MergeTree 2020-07-12 22:21:51 +08:00
Alexey Milovidov
49f60ef3a4 Fix build 2020-07-12 08:26:33 +03:00
Alexey Milovidov
204a4af394 Rollback insertion error in Log engines #12402 2020-07-12 05:32:18 +03:00
Ivan Babrou
8784994d65 Allow conditions outside of PK with exact range
Conditions that are outside of PK are marked as `unknown` in `KeyCondition`,
so it's safe to allow them, as long as they are always combined by `AND`.
2020-07-11 18:59:26 -07:00
Azat Khuzhin
3bee98c6f0 Fix lifetime_bytes/lifetime_rows for Buffer direct block write 2020-07-12 01:16:05 +03:00
Ivan Babrou
d9d8d0242e Optimize PK lookup for queries that match exact PK range
Existing code that looks up marks that match the query has a pathological
case, when most of the part does in fact match the query.

The code works by recursively splitting a part into ranges and then discarding
the ranges that definitely do not match the query, based on primary key.

The problem is that it requires visiting every mark that matches the query,
making the complexity of this sort of look up O(n).

For queries that match exact range on the primary key, we can find
both left and right parts of the range with O(log 2) complexity.

This change implements exactly that.

To engage this optimization, the query must:

* Have a prefix list of the primary key.
* Have only range or single set element constraints for columns.
* Have only AND as a boolean operator.

Consider a table with `(service, timestamp)` as the primary key.

The following conditions will be optimized:

* `service = 'foo'`
* `service = 'foo' and timestamp >= now() - 3600`
* `service in ('foo')`
* `service in ('foo') and timestamp >= now() - 3600 and timestamp <= now`

The following will fall back to previous lookup algorithm:

* `timestamp >= now() - 3600`
* `service in ('foo', 'bar') and timestamp >= now() - 3600`
* `service = 'foo'`

Note that the optimization won't engage when PK has a range expression
followed by a point expression, since in that case the range is not continuous.

Trace query logging provides the following messages types of messages,
each representing a different kind of PK usage for a part:

```
Used optimized inclusion search over index for part 20200711_5710108_5710108_0 with 9 steps
Used generic exclusion search over index for part 20200711_5710118_5710228_5 with 1495 steps
Not using index on part 20200710_5710473_5710473_0
```

Number of steps translates to computational complexity.

Here's a comparison for before and after for a query over 24h of data:

```
Read 4562944 rows, 148.05 MiB in 45.19249672 sec.,   100966 rows/sec.,   3.28 MiB/sec.
Read 4183040 rows, 135.78 MiB in 0.196279627 sec., 21311636 rows/sec., 691.75 MiB/sec.
```

This is especially useful for queries that read data in order
and terminate early to return "last X things" matching a query.

See #11564 for more thoughts on this.
2020-07-11 12:26:54 -07:00
Denis Glazachev
edb6ef8c09 Merge commit 'ceac649c01b0158090cd271776f3219f5e7ff57c' into ldap-per-user-authentication
* commit 'ceac649c01b0158090cd271776f3219f5e7ff57c': (75 commits)
  [docs] split misc statements (#12403)
  Update 00405_pretty_formats.reference
  Update PrettyCompactBlockOutputFormat.cpp
  Update PrettyBlockOutputFormat.cpp
  Update DataTypeNullable.cpp
  Update 01383_remote_ambiguous_column_shard.sql
  add output_format_pretty_grid_charset setting in docs
  add setting output_format_pretty_grid_charset
  Added a test for #11135
  Update index.md
  RIGHT and FULL JOIN for MergeJoin (#12118)
  Update MergeTreeIndexFullText.cpp
  restart the tests
  [docs] add syntax highlight (#12398)
  query fuzzer
  Fix std::bad_typeid when JSON functions called with argument of wrong type.
  Allow typeid_cast() to cast nullptr to nullptr.
  fix another context-related segfault
  [security docs] actually, only admins can create advisories
  query fuzzer
  ...
2020-07-11 21:32:36 +04:00
Azat Khuzhin
32a45d0dee Implement lifetime_rows/lifetime_bytes for Buffer engine
Buffer engine is usually used on INSERTs, but right now there is no way
to track number of INSERTed rows per-table, since only summary metrics
exists:
- StorageBufferRows
- StorageBufferBytes

But it can be pretty useful to track INSERTed rows rate (and it can be
exposed via http_handlers for i.e. prometheus)
2020-07-11 16:06:11 +03:00
Azat Khuzhin
433fdffc19 Add lifetime_rows/lifetime_bytes interface (exported via system.tables) 2020-07-11 15:33:11 +03:00
Azat Khuzhin
84c93a6b02 Tiny IStorage refactoring 2020-07-11 15:17:06 +03:00