提交 fd747dda 编写于 作者: I Ivan Blinkov

Move table engines out of top level too

上级 a7dd87b4
......@@ -361,7 +361,7 @@ Example of settings:
Setting fields:
- `host` – The ClickHouse host. If it is a local host, the query is processed without any network activity. To improve fault tolerance, you can create a [Distributed](../table_engines/distributed.md#table_engines-distributed) table and enter it in subsequent configurations.
- `host` – The ClickHouse host. If it is a local host, the query is processed without any network activity. To improve fault tolerance, you can create a [Distributed](../operations/table_engines/distributed.md#table_engines-distributed) table and enter it in subsequent configurations.
- `port` – The port on the ClickHouse server.
- `user` – Name of the ClickHouse user.
- `password` – Password of the ClickHouse user.
......
......@@ -58,5 +58,5 @@ This lets us use the system as the back-end for a web interface. Low latency mea
## Data replication and support for data integrity on replicas
Uses asynchronous multimaster replication. After being written to any available replica, data is distributed to all the remaining replicas. The system maintains identical data on different replicas. Data is restored automatically after a failure, or using a "button" for complex cases.
For more information, see the section [Data replication](../table_engines/replication.md#table_engines-replication).
For more information, see the section [Data replication](../operations/table_engines/replication.md#table_engines-replication).
......@@ -61,7 +61,7 @@ Users are recorded in the `users` section. Here is a fragment of the `users.xml`
You can see a declaration from two users: `default` and `web`. We added the `web` user separately.
The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../table_engines/distributed.md#table_engines-distributed) engine).
The `default` user is chosen in cases when the username is not passed. The `default` user is also used for distributed query processing, if the configuration of the server or cluster doesn't specify the `user` and `password` (see the section on the [Distributed](../operations/table_engines/distributed.md#table_engines-distributed) engine).
The user that is used for exchanging information between servers combined in a cluster must not have substantial restrictions or quotas – otherwise, distributed queries will fail.
......
......@@ -179,7 +179,7 @@ You can configure multiple `<graphite>` clauses. For instance, you can use this
Settings for thinning data for Graphite.
For more information, see [GraphiteMergeTree](../../table_engines/graphitemergetree.md#table_engines-graphitemergetree).
For more information, see [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md#table_engines-graphitemergetree).
**Example**
......@@ -358,7 +358,7 @@ Parameter substitutions for replicated tables.
Can be omitted if replicated tables are not used.
For more information, see the section "[Creating replicated tables](../../table_engines/replication.md#table_engines-replication-creation_of_rep_tables)".
For more information, see the section "[Creating replicated tables](../../operations/table_engines/replication.md#table_engines-replication-creation_of_rep_tables)".
**Example**
......@@ -370,7 +370,7 @@ For more information, see the section "[Creating replicated tables](../../table_
## mark_cache_size
Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) engines.
Approximate size (in bytes) of the cache of "marks" used by [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) engines.
The cache is shared for the server and memory is allocated as needed. The cache size must be at least 5368709120.
......@@ -426,7 +426,7 @@ We recommend using this option in Mac OS X, since the ` getrlimit()` function re
Restriction on deleting tables.
If the size of a [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) type table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query.
If the size of a [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) type table exceeds `max_table_size_to_drop` (in bytes), you can't delete it using a DROP query.
If you still need to delete the table without restarting the ClickHouse server, create the ` <clickhouse-path>/flags/force_drop_table` file and run the DROP query.
......@@ -444,7 +444,7 @@ The value 0 means that you can delete all tables without any restrictions.
## merge_tree
Fine tuning for tables in the [ MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) family.
Fine tuning for tables in the [ MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) family.
For more information, see the MergeTreeSettings.h header file.
......@@ -521,7 +521,7 @@ Keys for server/client settings:
## part_log
Logging events that are associated with [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) data. For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process.
Logging events that are associated with [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) data. For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process.
Queries are logged in the ClickHouse table, not in a separate file.
......@@ -541,7 +541,7 @@ Use the following parameters to configure logging:
- database – Name of the database.
- table – Name of the table.
- partition_by – Sets a [custom partitioning key](../../table_engines/custom_partitioning_key.md#custom-partitioning-key).
- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key).
- flush_interval_milliseconds – Interval for flushing data from memory to the disk.
**Example**
......@@ -585,7 +585,7 @@ Use the following parameters to configure logging:
- database – Name of the database.
- table – Name of the table.
- partition_by – Sets a [custom partitioning key](../../table_engines/custom_partitioning_key.md#custom-partitioning-key).
- partition_by – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key).
- flush_interval_milliseconds – Interval for flushing data from memory to the disk.
If the table doesn't exist, ClickHouse will create it. If the structure of the query log changed when the ClickHouse server was updated, the table with the old structure is renamed, and a new table is created automatically.
......@@ -607,7 +607,7 @@ If the table doesn't exist, ClickHouse will create it. If the structure of the q
Configuration of clusters used by the Distributed table engine.
For more information, see the section "[Table engines/Distributed](../../table_engines/distributed.md#table_engines-distributed)".
For more information, see the section "[Table engines/Distributed](../../operations/table_engines/distributed.md#table_engines-distributed)".
**Example**
......@@ -667,7 +667,7 @@ The end slash is mandatory.
## uncompressed_cache_size
Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) family.
Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) family.
There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache](../settings/settings.md#settings-use_uncompressed_cache) is enabled.
......@@ -716,7 +716,7 @@ ClickHouse uses ZooKeeper for storing replica metadata when using replicated tab
This parameter can be omitted if replicated tables are not used.
For more information, see the section "[Replication](../../table_engines/replication.md#table_engines-replication)".
For more information, see the section "[Replication](../../operations/table_engines/replication.md#table_engines-replication)".
**Example**
......
......@@ -20,7 +20,7 @@ The possible values ​​are:
## fallback_to_stale_replicas_for_distributed_queries
Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../table_engines/replication.md#table_engines-replication)".
Forces a query to an out-of-date replica if updated data is not available. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)".
ClickHouse selects the most relevant from the outdated replicas of the table.
......@@ -36,7 +36,7 @@ Disables query execution if the index can't be used by date.
Works with tables in the MergeTree family.
If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)".
If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)".
<a name="settings-settings-force_primary_key"></a>
......@@ -46,7 +46,7 @@ Disables query execution if indexing by the primary key is not possible.
Works with tables in the MergeTree family.
If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)".
If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition actually reduces the amount of data to read. For more information about data ranges in MergeTree tables, see "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)".
<a name="settings_settings_fsync_metadata"></a>
......@@ -125,7 +125,7 @@ This is slightly more than `max_block_size`. The reason for this is because cert
## max_replica_delay_for_distributed_queries
Disables lagging replicas for distributed queries. See "[Replication](../../table_engines/replication.md#table_engines-replication)".
Disables lagging replicas for distributed queries. See "[Replication](../../operations/table_engines/replication.md#table_engines-replication)".
Sets the time in seconds. If a replica lags more than the set value, this replica is not used.
......@@ -158,7 +158,7 @@ Don't confuse blocks for compression (a chunk of memory consisting of bytes) and
## min_compress_block_size
For [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536.
For [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)" tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least 'min_compress_block_size'. By default, 65,536.
The actual size of the block, if the uncompressed data is less than 'max_compress_block_size', is no less than this value and no less than the volume of data for one mark.
......
......@@ -127,7 +127,7 @@ This is similar to the DUAL table found in other DBMSs.
## system.parts
Contains information about parts of a table in the [MergeTree](../table_engines/mergetree.md#table_engines-mergetree) family.
Contains information about parts of a table in the [MergeTree](../operations/table_engines/mergetree.md#table_engines-mergetree) family.
Each row describes one part of the data.
......
......@@ -61,7 +61,7 @@ WHERE name = 'products'
└──────────┴──────┴────────┴─────────────────┴─────────────────┴─────────────────┴───────────────┴─────────────────┘
```
You can use the [dictGet*](../functions/ext_dict_functions.md#ext_dict_functions) function to get the dictionary data in this format.
You can use the [dictGet*](../../functions/ext_dict_functions.md#ext_dict_functions) function to get the dictionary data in this format.
This view isn't helpful when you need to get raw data, or when performing a `JOIN` operation. For these cases, you can use the `Dictionary` engine, which displays the dictionary data in a table.
......
......@@ -16,13 +16,13 @@ Usage examples:
File(Format)
```
`Format` should be supported for either `INSERT` and `SELECT`. For the full list of supported formats see [Formats](../interfaces/formats.md#formats).
`Format` should be supported for either `INSERT` and `SELECT`. For the full list of supported formats see [Formats](../../interfaces/formats.md#formats).
ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../operations/server_settings/settings.md#server_settings-path) setting in server configuration.
ClickHouse does not allow to specify filesystem path for`File`. It will use folder defined by [path](../server_settings/settings.md#server_settings-path) setting in server configuration.
When creating table using `File(Format)` it creates empty subdirectory in that folder. When data is written to that table, it's put into `data.Format` file in that subdirectory.
You may manually create this subfolder and file in server filesystem and then [ATTACH](../query_language/queries.md#queries-attach) it to table information with matching name, so you can query data from that file.
You may manually create this subfolder and file in server filesystem and then [ATTACH](../../query_language/queries.md#queries-attach) it to table information with matching name, so you can query data from that file.
<div class="admonition warning">
Be careful with this funcionality, because ClickHouse does not keep track of external changes to such files. The result of simultaneous writes via ClickHouse and outside of ClickHouse is undefined.
......@@ -61,7 +61,7 @@ SELECT * FROM file_engine_table
## Usage in clickhouse-local
In [clickhouse-local](../operations/utils/clickhouse-local.md#utils-clickhouse-local) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`.
In [clickhouse-local](../utils/clickhouse-local.md#utils-clickhouse-local) File engine accepts file path in addition to `Format`. Default input/output streams can be specified using numeric or human-readable names like `0` or `stdin`, `1` or `stdout`.
**Example:**
......
......@@ -14,7 +14,7 @@ Graphite stores full data in ClickHouse, and data can be retrieved in the follow
Using the `GraphiteMergeTree` engine.
The engine inherits properties from MergeTree. The settings for thinning data are defined by the [graphite_rollup](../operations/server_settings/settings.md#server_settings-graphite_rollup) parameter in the server configuration.
The engine inherits properties from MergeTree. The settings for thinning data are defined by the [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) parameter in the server configuration.
## Using the engine
......
......@@ -67,7 +67,7 @@ Example:
SELECT level, sum(total) FROM daily GROUP BY level;
```
To improve performance, received messages are grouped into blocks the size of [max_insert_block_size](../operations/settings/settings.md#settings-settings-max_insert_block_size). If the block wasn't formed within [stream_flush_interval_ms](../operations/settings/settings.md#settings-settings_stream_flush_interval_ms) milliseconds, the data will be flushed to the table regardless of the completeness of the block.
To improve performance, received messages are grouped into blocks the size of [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). If the block wasn't formed within [stream_flush_interval_ms](../settings/settings.md#settings-settings_stream_flush_interval_ms) milliseconds, the data will be flushed to the table regardless of the completeness of the block.
To stop receiving topic data or to change the conversion logic, detach the materialized view:
......
# MaterializedView
Used for implementing materialized views (for more information, see the [CREATE TABLE](../../query_language/queries.md#query_language-queries-create_table)) query. For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine.
......@@ -56,7 +56,7 @@ In this example, the index can't be used.
SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%'
```
To check whether ClickHouse can use the index when executing the query, use the settings [force_index_by_date](../operations/settings/settings.md#settings-settings-force_index_by_date)and[force_primary_key](../operations/settings/settings.md#settings-settings-force_primary_key).
To check whether ClickHouse can use the index when executing the query, use the settings [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date)and[force_primary_key](../settings/settings.md#settings-settings-force_primary_key).
The index by date only allows reading those parts that contain dates from the desired range. However, a data part may contain data for many dates (up to an entire month), while within a single part the data is ordered by the primary key, which might not contain the date as the first column. Because of this, using a query with only a date condition that does not specify the primary key prefix will cause more data to be read than for a single date.
......
......@@ -15,7 +15,7 @@ Replication works at the level of an individual table, not the entire server. A
Replication does not depend on sharding. Each shard has its own independent replication.
Compressed data is replicated for `INSERT` and `ALTER` queries (see the description of the [ALTER](../query_language/queries.md#query_language_queries_alter) query).
Compressed data is replicated for `INSERT` and `ALTER` queries (see the description of the [ALTER](../../query_language/queries.md#query_language_queries_alter) query).
`CREATE`, `DROP`, `ATTACH`, `DETACH` and `RENAME` queries are executed on a single server and are not replicated:
......@@ -48,7 +48,7 @@ You can specify any existing ZooKeeper cluster and the system will use a directo
If ZooKeeper isn't set in the config file, you can't create replicated tables, and any existing replicated tables will be read-only.
ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../operations/settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../operations/settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries).
ZooKeeper is not used in `SELECT` queries because replication does not affect the performance of `SELECT` and queries run just as fast as they do for non-replicated tables. When querying distributed replicated tables, ClickHouse behavior is controlled by the settings [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) and [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries).
For each `INSERT` query, approximately ten entries are added to ZooKeeper through several transactions. (To be more precise, this is for each inserted block of data; an INSERT query contains one block or one block per `max_insert_block_size = 1048576` rows.) This leads to slightly longer latencies for `INSERT` compared to non-replicated tables. But if you follow the recommendations to insert data in batches of no more than one `INSERT` per second, it doesn't create any problems. The entire ClickHouse cluster used for coordinating one ZooKeeper cluster has a total of several hundred `INSERTs` per second. The throughput on data inserts (the number of rows per second) is just as high as for non-replicated data.
......@@ -60,7 +60,7 @@ By default, an INSERT query waits for confirmation of writing the data from only
Each block of data is written atomically. The INSERT query is divided into blocks up to `max_insert_block_size = 1048576` rows. In other words, if the `INSERT` query has less than 1048576 rows, it is made atomically.
Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../operations/server_settings/settings.md#server_settings-merge_tree) server settings.
Data blocks are deduplicated. For multiple writes of the same data block (data blocks of the same size containing the same rows in the same order), the block is only written once. The reason for this is in case of network failures when the client application doesn't know if the data was written to the DB, so the `INSERT` query can simply be repeated. It doesn't matter which replica INSERTs were sent to with identical data. `INSERTs` are idempotent. Deduplication parameters are controlled by [merge_tree](../server_settings/settings.md#server_settings-merge_tree) server settings.
During replication, only the source data to insert is transferred over the network. Further data transformation (merging) is coordinated and performed on all the replicas in the same way. This minimizes network usage, which means that replication works well when replicas reside in different datacenters. (Note that duplicating data in different datacenters is the main goal of replication.)
......
# MaterializedView
Used for implementing materialized views (for more information, see the [CREATE TABLE](../query_language/queries.md#query_language-queries-create_table)) query. For storing data, it uses a different engine that was specified when creating the view. When reading from a table, it just uses this engine.
......@@ -55,37 +55,6 @@ pages:
- 'Queries': 'query_language/queries.md'
- 'Syntax': 'query_language/syntax.md'
- 'Table engines':
- 'Introduction': 'table_engines/index.md'
- 'MergeTree family':
- 'MergeTree': 'table_engines/mergetree.md'
- 'Data replication': 'table_engines/replication.md'
- 'Custom partitioning key': 'table_engines/custom_partitioning_key.md'
- 'ReplacingMergeTree': 'table_engines/replacingmergetree.md'
- 'SummingMergeTree': 'table_engines/summingmergetree.md'
- 'AggregatingMergeTree': 'table_engines/aggregatingmergetree.md'
- 'CollapsingMergeTree': 'table_engines/collapsingmergetree.md'
- 'GraphiteMergeTree': 'table_engines/graphitemergetree.md'
- 'For small data':
- 'TinyLog': 'table_engines/tinylog.md'
- 'Log': 'table_engines/log.md'
- 'Memory': 'table_engines/memory.md'
- 'Buffer': 'table_engines/buffer.md'
- 'External data': 'table_engines/external_data.md'
- 'Special':
- 'Distributed': 'table_engines/distributed.md'
- 'Dictionary': 'table_engines/dictionary.md'
- 'Merge': 'table_engines/merge.md'
- 'File': 'table_engines/file.md'
- 'Null': 'table_engines/null.md'
- 'Set': 'table_engines/set.md'
- 'Join': 'table_engines/join.md'
- 'View': 'table_engines/view.md'
- 'MaterializedView': 'table_engines/materializedview.md'
- 'Integrations':
- 'Kafka': 'table_engines/kafka.md'
- 'MySQL': 'table_engines/mysql.md'
- 'Table functions':
- 'Introduction': 'table_functions/index.md'
- 'file': 'table_functions/file.md'
......@@ -143,6 +112,36 @@ pages:
- 'Operations':
- 'Operations': 'operations/index.md'
- 'Table engines':
- 'Introduction': 'operations/table_engines/index.md'
- 'MergeTree family':
- 'MergeTree': 'operations/table_engines/mergetree.md'
- 'Data replication': 'operations/table_engines/replication.md'
- 'Custom partitioning key': 'operations/table_engines/custom_partitioning_key.md'
- 'ReplacingMergeTree': 'operations/table_engines/replacingmergetree.md'
- 'SummingMergeTree': 'operations/table_engines/summingmergetree.md'
- 'AggregatingMergeTree': 'operations/table_engines/aggregatingmergetree.md'
- 'CollapsingMergeTree': 'operations/table_engines/collapsingmergetree.md'
- 'GraphiteMergeTree': 'operations/table_engines/graphitemergetree.md'
- 'For small data':
- 'TinyLog': 'operations/table_engines/tinylog.md'
- 'Log': 'operations/table_engines/log.md'
- 'Memory': 'operations/table_engines/memory.md'
- 'Buffer': 'operations/table_engines/buffer.md'
- 'External data': 'operations/table_engines/external_data.md'
- 'Special':
- 'Distributed': 'operations/table_engines/distributed.md'
- 'Dictionary': 'operations/table_engines/dictionary.md'
- 'Merge': 'operations/table_engines/merge.md'
- 'File': 'operations/table_engines/file.md'
- 'Null': 'operations/table_engines/null.md'
- 'Set': 'operations/table_engines/set.md'
- 'Join': 'operations/table_engines/join.md'
- 'View': 'operations/table_engines/view.md'
- 'MaterializedView': 'operations/table_engines/materializedview.md'
- 'Integrations':
- 'Kafka': 'operations/table_engines/kafka.md'
- 'MySQL': 'operations/table_engines/mysql.md'
- 'Access rights': 'operations/access_rights.md'
- 'Configuration files': 'operations/configuration_files.md'
- 'Quotas': 'operations/quotas.md'
......
......@@ -55,37 +55,6 @@ pages:
- 'Запросы': 'query_language/queries.md'
- 'Синтаксис': 'query_language/syntax.md'
- 'Движки таблиц':
- 'Введение': 'table_engines/index.md'
- 'Семейство MergeTree':
- 'MergeTree': 'table_engines/mergetree.md'
- 'Репликация данных': 'table_engines/replication.md'
- 'Произвольный ключ партиционирования': 'table_engines/custom_partitioning_key.md'
- 'ReplacingMergeTree': 'table_engines/replacingmergetree.md'
- 'SummingMergeTree': 'table_engines/summingmergetree.md'
- 'AggregatingMergeTree': 'table_engines/aggregatingmergetree.md'
- 'CollapsingMergeTree': 'table_engines/collapsingmergetree.md'
- 'GraphiteMergeTree': 'table_engines/graphitemergetree.md'
- 'Для небольших объемов данных':
- 'TinyLog': 'table_engines/tinylog.md'
- 'Log': 'table_engines/log.md'
- 'Memory': 'table_engines/memory.md'
- 'Buffer': 'table_engines/buffer.md'
- 'Внешние данные': 'table_engines/external_data.md'
- 'Особые':
- 'Distributed': 'table_engines/distributed.md'
- 'Dictionary': 'table_engines/dictionary.md'
- 'Merge': 'table_engines/merge.md'
- 'File': 'table_engines/file.md'
- 'Null': 'table_engines/null.md'
- 'Set': 'table_engines/set.md'
- 'Join': 'table_engines/join.md'
- 'View': 'table_engines/view.md'
- 'MaterializedView': 'table_engines/materializedview.md'
- 'Интеграции':
- 'Kafka': 'table_engines/kafka.md'
- 'MySQL': 'table_engines/mysql.md'
- 'Табличные функции':
- 'Введение': 'table_functions/index.md'
- 'file': 'table_functions/file.md'
......@@ -144,6 +113,36 @@ pages:
- 'Эксплуатация':
# - 'Эксплуатация': 'operations/index.md'
- 'Движки таблиц':
- 'Введение': 'operations/table_engines/index.md'
- 'Семейство MergeTree':
- 'MergeTree': 'operations/table_engines/mergetree.md'
- 'Репликация данных': 'operations/table_engines/replication.md'
- 'Произвольный ключ партиционирования': 'operations/table_engines/custom_partitioning_key.md'
- 'ReplacingMergeTree': 'operations/table_engines/replacingmergetree.md'
- 'SummingMergeTree': 'operations/table_engines/summingmergetree.md'
- 'AggregatingMergeTree': 'operations/table_engines/aggregatingmergetree.md'
- 'CollapsingMergeTree': 'operations/table_engines/collapsingmergetree.md'
- 'GraphiteMergeTree': 'operations/table_engines/graphitemergetree.md'
- 'Для небольших объемов данных':
- 'TinyLog': 'operations/table_engines/tinylog.md'
- 'Log': 'operations/table_engines/log.md'
- 'Memory': 'operations/table_engines/memory.md'
- 'Buffer': 'operations/table_engines/buffer.md'
- 'Внешние данные': 'operations/table_engines/external_data.md'
- 'Особые':
- 'Distributed': 'operations/table_engines/distributed.md'
- 'Dictionary': 'operations/table_engines/dictionary.md'
- 'Merge': 'operations/table_engines/merge.md'
- 'File': 'operations/table_engines/file.md'
- 'Null': 'operations/table_engines/null.md'
- 'Set': 'operations/table_engines/set.md'
- 'Join': 'operations/table_engines/join.md'
- 'View': 'operations/table_engines/view.md'
- 'MaterializedView': 'operations/table_engines/materializedview.md'
- 'Интеграции':
- 'Kafka': 'operations/table_engines/kafka.md'
- 'MySQL': 'operations/table_engines/mysql.md'
- 'Права доступа': 'operations/access_rights.md'
- 'Конфигурационные файлы': 'operations/configuration_files.md'
- 'Квоты': 'operations/quotas.md'
......
......@@ -44,3 +44,29 @@ formats/xml.md formats/interfaces.md
utils/clickhouse-copier.md operations/utils/clickhouse-copier.md
utils/clickhouse-local.md operations/utils/clickhouse-local.md
utils.md operations/utils.md
table_engines.md operations/table_engines.md
table_engines/aggregatingmergetree.md operations/table_engines/aggregatingmergetree.md
table_engines/buffer.md operations/table_engines/buffer.md
table_engines/collapsingmergetree.md operations/table_engines/collapsingmergetree.md
table_engines/custom_partitioning_key.md operations/table_engines/custom_partitioning_key.md
table_engines/dictionary.md operations/table_engines/dictionary.md
table_engines/distributed.md operations/table_engines/distributed.md
table_engines/external_data.md operations/table_engines/external_data.md
table_engines/file.md operations/table_engines/file.md
table_engines/graphitemergetree.md operations/table_engines/graphitemergetree.md
table_engines/index.md operations/table_engines/index.md
table_engines/join.md operations/table_engines/join.md
table_engines/kafka.md operations/table_engines/kafka.md
table_engines/log.md operations/table_engines/log.md
table_engines/materializedview.md operations/table_engines/materializedview.md
table_engines/memory.md operations/table_engines/memory.md
table_engines/merge.md operations/table_engines/merge.md
table_engines/mergetree.md operations/table_engines/mergetree.md
table_engines/mysql.md operations/table_engines/mysql.md
table_engines/null.md operations/table_engines/null.md
table_engines/replacingmergetree.md operations/table_engines/replacingmergetree.md
table_engines/replication.md operations/table_engines/replication.md
table_engines/set.md operations/table_engines/set.md
table_engines/summingmergetree.md operations/table_engines/summingmergetree.md
table_engines/tinylog.md operations/table_engines/tinylog.md
table_engines/view.md operations/table_engines/view.md
......@@ -355,7 +355,7 @@ MySQL можно подключить на локальном хосте чер
Поля настройки:
- `host` - хост ClickHouse. Если host локальный, то запрос выполняется без сетевого взаимодействия. Чтобы повысить отказоустойчивость решения, можно создать таблицу типа [Distributed](../table_engines/distributed.md#table_engines-distributed) и прописать её в дальнейших настройках.
- `host` - хост ClickHouse. Если host локальный, то запрос выполняется без сетевого взаимодействия. Чтобы повысить отказоустойчивость решения, можно создать таблицу типа [Distributed](../operations/table_engines/distributed.md#table_engines-distributed) и прописать её в дальнейших настройках.
- `port` - порт сервера ClickHouse.
- `user` - имя пользователя ClickHouse.
- `password` - пароль пользователя ClickHouse.
......
......@@ -58,4 +58,4 @@ ClickHouse поддерживает таблицы с первичным клю
## Репликация данных, поддержка целостности данных на репликах
Используется асинхронная multimaster репликация. После записи на любую доступную реплику, данные распространяются на все остальные реплики. Система поддерживает полную идентичность данных на разных репликах. Восстановление после сбоя осуществляется автоматически, а в сложных случаях - "по кнопке".
Подробнее смотрите раздел [Репликация данных](../table_engines/replication.md#table_engines-replication).
Подробнее смотрите раздел [Репликация данных](../operations/table_engines/replication.md#table_engines-replication).
......@@ -61,7 +61,7 @@
Здесь видно объявление двух пользователей - `default` и `web`. Пользователя `web` мы добавили самостоятельно.
Пользователь `default` выбирается в случаях, когда имя пользователя не передаётся. Также пользователь `default` может использоваться при распределённой обработке запроса - если в конфигурации кластера для сервера не указаны `user` и `password`. (см. раздел о движке [Distributed](../table_engines/distributed.md#table_engines-distributed)).
Пользователь `default` выбирается в случаях, когда имя пользователя не передаётся. Также пользователь `default` может использоваться при распределённой обработке запроса - если в конфигурации кластера для сервера не указаны `user` и `password`. (см. раздел о движке [Distributed](../operations/table_engines/distributed.md#table_engines-distributed)).
Пользователь, который используется для обмена информацией между серверами, объединенными в кластер, не должен иметь существенных ограничений или квот - иначе распределённые запросы сломаются.
......
......@@ -180,7 +180,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
Настройка прореживания данных для Graphite.
Подробнее читайте в разделе [GraphiteMergeTree](../../table_engines/graphitemergetree.md#table_engines-graphitemergetree).
Подробнее читайте в разделе [GraphiteMergeTree](../../operations/table_engines/graphitemergetree.md#table_engines-graphitemergetree).
**Пример**
......@@ -360,7 +360,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
Можно не указывать, если реплицируемых таблицы не используются.
Подробнее смотрите в разделе "[Создание реплицируемых таблиц](../../table_engines/replication.md#table_engines-replication-creation_of_rep_tables)".
Подробнее смотрите в разделе "[Создание реплицируемых таблиц](../../operations/table_engines/replication.md#table_engines-replication-creation_of_rep_tables)".
**Пример**
......@@ -372,7 +372,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
## mark_cache_size
Приблизительный размер (в байтах) кеша "засечек", используемых движками таблиц семейства [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree).
Приблизительный размер (в байтах) кеша "засечек", используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree).
Кеш общий для сервера, память выделяется по мере необходимости. Кеш не может быть меньше, чем 5368709120.
......@@ -428,7 +428,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
Ограничение на удаление таблиц.
Если размер таблицы семейства [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree) превышает `max_table_size_to_drop` (в байтах), то ее нельзя удалить запросом DROP.
Если размер таблицы семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree) превышает `max_table_size_to_drop` (в байтах), то ее нельзя удалить запросом DROP.
Если таблицу все же необходимо удалить, не перезапуская при этом сервер ClickHouse, то необходимо создать файл `<clickhouse-path>/flags/force_drop_table` и выполнить запрос DROP.
......@@ -446,7 +446,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
## merge_tree
Тонкая настройка таблиц семейства [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree).
Тонкая настройка таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree).
Подробнее смотрите в заголовочном файле MergeTreeSettings.h.
......@@ -523,7 +523,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
## part_log
Логгирование событий, связанных с данными типа [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree). Например, события добавления или мержа данных. Лог можно использовать для симуляции алгоритмов слияния, чтобы сравнивать их характеристики. Также, можно визуализировать процесс слияния.
Логгирование событий, связанных с данными типа [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree). Например, события добавления или мержа данных. Лог можно использовать для симуляции алгоритмов слияния, чтобы сравнивать их характеристики. Также, можно визуализировать процесс слияния.
Запросы логгируются не в отдельный файл, а в таблицу ClickHouse.
......@@ -543,7 +543,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
- database - Имя базы данных.
- table - Имя таблицы.
- partition_by - Устанавливает [произвольный ключ партиционирования](../../table_engines/custom_partitioning_key.md#custom-partitioning-key).
- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key).
- flush_interval_milliseconds - Период сброса данных из оперативной памяти на диск.
......@@ -588,7 +588,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
- database - Имя базы данных.
- table - Имя таблицы.
- partition_by - Устанавливает [произвольный ключ партиционирования](../../table_engines/custom_partitioning_key.md#custom-partitioning-key).
- partition_by - Устанавливает [произвольный ключ партиционирования](../../operations/table_engines/custom_partitioning_key.md#custom-partitioning-key).
- flush_interval_milliseconds - Период сброса данных из оперативной памяти на диск.
Если таблица не существует, то ClickHouse создаст её. Если структура журнала запросов изменилась при обновлении сервера ClickHouse, то таблица со старой структурой переименовывается, а новая таблица создается автоматически.
......@@ -610,7 +610,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
Конфигурация кластеров, которые использует движок таблиц Distributed.
Пример настройки смотрите в разделе "[Движки таблиц/Distributed](../../table_engines/distributed.md#table_engines-distributed)".
Пример настройки смотрите в разделе "[Движки таблиц/Distributed](../../operations/table_engines/distributed.md#table_engines-distributed)".
**Пример**
......@@ -671,7 +671,7 @@ ClickHouse проверит условия `min_part_size` и `min_part_size_rat
## uncompressed_cache_size
Размер кеша (в байтах) для несжатых данных, используемых движками таблиц семейства [MergeTree](../../table_engines/mergetree.md#table_engines-mergetree).
Размер кеша (в байтах) для несжатых данных, используемых движками таблиц семейства [MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree).
Кеш единый для сервера. Память выделяется по-требованию. Кеш используется в том случае, если включена опция [use_uncompressed_cache](../settings/settings.md#settings-use_uncompressed_cache).
......@@ -720,7 +720,7 @@ ClickHouse использует ZooKeeper для хранения метадан
Параметр можно не указывать, если реплицированные таблицы не используются.
Подробно читайте в разделе "[Репликация](../../table_engines/replication.md#table_engines-replication)".
Подробно читайте в разделе "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)".
**Пример**
......
......@@ -26,7 +26,7 @@ ClickHouse применяет настройку в тех случаях, ко
## fallback_to_stale_replicas_for_distributed_queries
Форсирует запрос в устаревшую реплику в случае, если актуальные данные недоступны. Смотрите "[Репликация](../../table_engines/replication.md#table_engines-replication)".
Форсирует запрос в устаревшую реплику в случае, если актуальные данные недоступны. Смотрите "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)".
Из устаревших реплик таблицы ClickHouse выбирает наиболее актуальную.
......@@ -42,7 +42,7 @@ ClickHouse применяет настройку в тех случаях, ко
Работает с таблицами семейства MergeTree.
При `force_index_by_date=1` ClickHouse проверяет, есть ли в запросе условие на ключ даты, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Например, условие `Date != '2000-01-01'` подходит даже в том случае, когда соответствует всем данным в таблице (т.е. для выполнения запроса требуется full scan). Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)".
При `force_index_by_date=1` ClickHouse проверяет, есть ли в запросе условие на ключ даты, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Например, условие `Date != '2000-01-01'` подходит даже в том случае, когда соответствует всем данным в таблице (т.е. для выполнения запроса требуется full scan). Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)".
<a name="settings-settings-force_primary_key"></a>
......@@ -52,7 +52,7 @@ ClickHouse применяет настройку в тех случаях, ко
Работает с таблицами семейства MergeTree.
При `force_primary_key=1` ClickHouse проверяет, есть ли в запросе условие на первичный ключ, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)".
При `force_primary_key=1` ClickHouse проверяет, есть ли в запросе условие на первичный ключ, которое может использоваться для отсечения диапазонов данных. Если подходящего условия нет - кидается исключение. При этом не проверяется, действительно ли условие уменьшает объём данных для чтения. Подробнее про диапазоны данных в таблицах MergeTree читайте в разделе "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)".
<a name="settings_settings_fsync_metadata"></a>
......@@ -131,7 +131,7 @@ ClickHouse применяет настройку в тех случаях, ко
## max_replica_delay_for_distributed_queries
Отключает отстающие реплики при распределенных запросах. Смотрите "[Репликация](../../table_engines/replication.md#table_engines-replication)".
Отключает отстающие реплики при распределенных запросах. Смотрите "[Репликация](../../operations/table_engines/replication.md#table_engines-replication)".
Устанавливает время в секундах. Если оставание реплики больше установленного значения, то реплика не используется.
......@@ -163,7 +163,7 @@ ClickHouse применяет настройку в тех случаях, ко
## min_compress_block_size
Для таблиц типа "[MergeTree](../../table_engines/mergetree.md#table_engines-mergetree)". В целях уменьшения задержек при обработке запросов, блок сжимается при записи следующей засечки, если его размер не меньше min_compress_block_size. По умолчанию - 65 536.
Для таблиц типа "[MergeTree](../../operations/table_engines/mergetree.md#table_engines-mergetree)". В целях уменьшения задержек при обработке запросов, блок сжимается при записи следующей засечки, если его размер не меньше min_compress_block_size. По умолчанию - 65 536.
Реальный размер блока, если несжатых данных меньше max_compress_block_size, будет не меньше этого значения и не меньше объёма данных на одну засечку.
......
......@@ -120,7 +120,7 @@ default_expression String - выражение для значения по ум
То есть, это - аналог таблицы DUAL, которую можно найти в других СУБД.
# system.parts
Содержит информацию о кусках таблиц семейства [MergeTree](../table_engines/mergetree.md#table_engines-mergetree).
Содержит информацию о кусках таблиц семейства [MergeTree](../operations/table_engines/mergetree.md#table_engines-mergetree).
Каждая строка описывает один кусок данных.
......
......@@ -60,7 +60,7 @@ WHERE name = 'products'
└──────────┴──────┴────────┴─────────────────┴─────────────────┴─────────────────┴───────────────┴─────────────────┘
```
В таком виде данные из словаря можно получить при помощи функций [dictGet*](../functions/ext_dict_functions.md#ext_dict_functions).
В таком виде данные из словаря можно получить при помощи функций [dictGet*](../../functions/ext_dict_functions.md#ext_dict_functions).
Такое представление неудобно, когда нам необходимо получить данные в чистом виде, а также при выполнении операции `JOIN`. Для этих случаев можно использовать движок `Dictionary`, который отобразит данные словаря в таблицу.
......
......@@ -16,13 +16,13 @@
File(Format)
```
`Format` должен быть таким, который ClickHouse может использовать и в запросах `INSERT` и в запросах `SELECT`. Полный список поддерживаемых форматов смотрите в разделе [Форматы](../interfaces/formats.md#formats).
`Format` должен быть таким, который ClickHouse может использовать и в запросах `INSERT` и в запросах `SELECT`. Полный список поддерживаемых форматов смотрите в разделе [Форматы](../../interfaces/formats.md#formats).
Сервер ClickHouse не позволяет указать путь к файлу, с которым будет работать `File`. Используется путь к хранилищу, определенный параметром [path](../operations/server_settings/settings.md#server_settings-path) в конфигурации сервера.
Сервер ClickHouse не позволяет указать путь к файлу, с которым будет работать `File`. Используется путь к хранилищу, определенный параметром [path](../server_settings/settings.md#server_settings-path) в конфигурации сервера.
При создании таблицы с помощью `File(Format)` сервер ClickHouse создает в хранилище каталог с именем таблицы, а после добавления в таблицу данных помещает туда файл `data.Format`.
Можно вручную создать в хранилище каталог таблицы, поместить туда файл, затем на сервере ClickHouse добавить ([ATTACH](../query_language/queries.md#queries-attach)) информацию о таблице, соответствующей имени каталога и прочитать из файла данные.
Можно вручную создать в хранилище каталог таблицы, поместить туда файл, затем на сервере ClickHouse добавить ([ATTACH](../../query_language/queries.md#queries-attach)) информацию о таблице, соответствующей имени каталога и прочитать из файла данные.
<div class="admonition warning">
Будьте аккуратны с этой функциональностью, поскольку сервер ClickHouse не отслеживает внешние изменения данных. Если в файл будет производиться запись одновременно со стороны сервера ClickHouse и с внешней стороны, то результат непредсказуем.
......@@ -61,7 +61,7 @@ SELECT * FROM file_engine_table
## Использование движка в clickhouse-local
В [clickhouse-local](../operations/utils/clickhouse-local.md#utils-clickhouse-local) движок в качестве параметра принимает не только формат, но и путь к файлу. В том числе можно указать стандартные потоки ввода/вывода цифровым или буквенным обозначением `0` или `stdin`, `1` или `stdout`.
В [clickhouse-local](../utils/clickhouse-local.md#utils-clickhouse-local) движок в качестве параметра принимает не только формат, но и путь к файлу. В том числе можно указать стандартные потоки ввода/вывода цифровым или буквенным обозначением `0` или `stdin`, `1` или `stdout`.
**Пример:**
......
......@@ -14,7 +14,7 @@ Graphite хранит в ClickHouse полные данные, а получат
Используется движок `GraphiteMergeTree`.
Движок наследует свойства MergeTree. Настройки прореживания данных задаются параметром [graphite_rollup](../operations/server_settings/settings.md#server_settings-graphite_rollup) в конфигурации сервера .
Движок наследует свойства MergeTree. Настройки прореживания данных задаются параметром [graphite_rollup](../server_settings/settings.md#server_settings-graphite_rollup) в конфигурации сервера .
## Использование движка
......
......@@ -67,7 +67,7 @@ Kafka(broker_list, topic_list, group_name, format[, schema, num_consumers])
SELECT level, sum(total) FROM daily GROUP BY level;
```
Для улучшения производительности полученные сообщения группируются в блоки размера [max_insert_block_size](../operations/settings/settings.md#settings-settings-max_insert_block_size). Если блок не удалось сформировать за [stream_flush_interval_ms](../operations/settings/settings.md#settings-settings_stream_flush_interval_ms) миллисекунд, то данные будут сброшены в таблицу независимо от полноты блока.
Для улучшения производительности полученные сообщения группируются в блоки размера [max_insert_block_size](../settings/settings.md#settings-settings-max_insert_block_size). Если блок не удалось сформировать за [stream_flush_interval_ms](../settings/settings.md#settings-settings_stream_flush_interval_ms) миллисекунд, то данные будут сброшены в таблицу независимо от полноты блока.
Чтобы остановить получение данных топика или изменить логику преобразования, отсоедините материализованное представление:
......@@ -97,4 +97,4 @@ Kafka(broker_list, topic_list, group_name, format[, schema, num_consumers])
</kafka_topic_logs>
```
В документе [librdkafka configuration reference](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md) можно увидеть список возможных опций конфигурации. Используйте подчёркивания (`_`) вместо точек в конфигурации ClickHouse, например, `check.crcs=true` будет соответствовать `<check_crcs>true</check_crcs>`.
\ No newline at end of file
В документе [librdkafka configuration reference](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md) можно увидеть список возможных опций конфигурации. Используйте подчёркивания (`_`) вместо точек в конфигурации ClickHouse, например, `check.crcs=true` будет соответствовать `<check_crcs>true</check_crcs>`.
# MaterializedView
Используется для реализации материализованных представлений (подробнее см. запрос [CREATE TABLE](../../query_language/queries.md#query_language-queries-create_table)). Для хранения данных, использует другой движок, который был указан при создании представления. При чтении из таблицы, просто использует этот движок.
......@@ -56,7 +56,7 @@ SELECT count() FROM table WHERE ((EventDate >= toDate('2014-01-01') AND EventDat
SELECT count() FROM table WHERE CounterID = 34 OR URL LIKE '%upyachka%'
```
Чтобы проверить, сможет ли ClickHouse использовать индекс при выполнении запроса, используйте настройки [force_index_by_date](../operations/settings/settings.md#settings-settings-force_index_by_date) и [force_primary_key](../operations/settings/settings.md#settings-settings-force_primary_key).
Чтобы проверить, сможет ли ClickHouse использовать индекс при выполнении запроса, используйте настройки [force_index_by_date](../settings/settings.md#settings-settings-force_index_by_date) и [force_primary_key](../settings/settings.md#settings-settings-force_primary_key).
Индекс по дате обеспечивает чтение только кусков, содержащих даты из нужного диапазона. При этом кусок данных может содержать данные за многие даты (до целого месяца), а в пределах одного куска данные лежат упорядоченными по первичному ключу, который может не содержать дату в качестве первого столбца. В связи с этим, при использовании запроса с указанием условия только на дату, но не на префикс первичного ключа, будет читаться данных больше, чем за одну дату.
......
......@@ -15,7 +15,7 @@
Репликация не зависит от шардирования. На каждом шарде репликация работает независимо.
Реплицируются сжатые данные запросов `INSERT`, `ALTER` (см. подробности в описании запроса [ALTER](../query_language/queries.md#query_language_queries_alter)).
Реплицируются сжатые данные запросов `INSERT`, `ALTER` (см. подробности в описании запроса [ALTER](../../query_language/queries.md#query_language_queries_alter)).
Запросы `CREATE`, `DROP`, `ATTACH`, `DETACH`, `RENAME` выполняются на одном сервере и не реплицируются:
......@@ -48,7 +48,7 @@
Если в конфигурационном файле не настроен ZooKeeper, то вы не сможете создать реплицируемые таблицы, а уже имеющиеся реплицируемые таблицы будут доступны в режиме только на чтение.
При запросах `SELECT`, ZooKeeper не используется, т.е. репликация не влияет на производительность `SELECT` и запросы работают так же быстро, как и для нереплицируемых таблиц. При запросах к распределенным реплицированным таблицам поведение ClickHouse регулируется настройками [max_replica_delay_for_distributed_queries](../operations/settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) и [fallback_to_stale_replicas_for_distributed_queries](../operations/settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries).
При запросах `SELECT`, ZooKeeper не используется, т.е. репликация не влияет на производительность `SELECT` и запросы работают так же быстро, как и для нереплицируемых таблиц. При запросах к распределенным реплицированным таблицам поведение ClickHouse регулируется настройками [max_replica_delay_for_distributed_queries](../settings/settings.md#settings_settings_max_replica_delay_for_distributed_queries) и [fallback_to_stale_replicas_for_distributed_queries](../settings/settings.md#settings-settings-fallback_to_stale_replicas_for_distributed_queries).
При каждом запросе `INSERT` (точнее, на каждый вставляемый блок данных; запрос INSERT содержит один блок, или по блоку на каждые `max_insert_block_size = 1048576` строк), делается около десятка записей в ZooKeeper в рамках нескольких транзакций. Это приводит к некоторому увеличению задержек при `INSERT`, по сравнению с нереплицируемыми таблицами. Но если придерживаться обычных рекомендаций - вставлять данные пачками не более одного `INSERT` в секунду, то это не составляет проблем. На всём кластере ClickHouse, использующим для координации один кластер ZooKeeper, может быть в совокупности несколько сотен `INSERT` в секунду. Пропускная способность при вставке данных (количество строчек в секунду) такая же высокая, как для нереплицируемых таблиц.
......@@ -60,7 +60,7 @@
Каждый блок данных записывается атомарно. Запрос INSERT разбивается на блоки данных размером до `max_insert_block_size = 1048576` строк. То есть, если в запросе `INSERT` менее 1048576 строк, то он делается атомарно.
Блоки данных дедуплицируются. При многократной записи одного и того же блока данных (блоков данных одинакового размера, содержащих одни и те же строчки в одном и том же порядке), блок будет записан только один раз. Это сделано для того, чтобы в случае сбоя в сети, когда клиентское приложение не может понять, были ли данные записаны в БД, можно было просто повторить запрос `INSERT`. При этом не имеет значения, на какую реплику будут отправлены INSERT-ы с одинаковыми данными. То есть, обеспечивается идемпотентность `INSERT`. Параметры дедупликации регулируются настройками сервера [merge_tree](../operations/server_settings/settings.md#server_settings-merge_tree).
Блоки данных дедуплицируются. При многократной записи одного и того же блока данных (блоков данных одинакового размера, содержащих одни и те же строчки в одном и том же порядке), блок будет записан только один раз. Это сделано для того, чтобы в случае сбоя в сети, когда клиентское приложение не может понять, были ли данные записаны в БД, можно было просто повторить запрос `INSERT`. При этом не имеет значения, на какую реплику будут отправлены INSERT-ы с одинаковыми данными. То есть, обеспечивается идемпотентность `INSERT`. Параметры дедупликации регулируются настройками сервера [merge_tree](../server_settings/settings.md#server_settings-merge_tree).
При репликации, по сети передаются только исходные вставляемые данные. Дальнейшие преобразования данных (слияния) координируются и делаются на всех репликах одинаковым образом. За счёт этого минимизируется использование сети, и благодаря этому, репликация хорошо работает при расположении реплик в разных датацентрах. (Стоит заметить, что дублирование данных в разных датацентрах, по сути, является основной задачей репликации).
......
# MaterializedView
Используется для реализации материализованных представлений (подробнее см. запрос [CREATE TABLE](../query_language/queries.md#query_language-queries-create_table)). Для хранения данных, использует другой движок, который был указан при создании представления. При чтении из таблицы, просто использует этот движок.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册