Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/getting-started/example-datasets/laion.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ CREATE TABLE laion
)
ENGINE = MergeTree
ORDER BY id
SETTINGS index_granularity = 8192
```

To import the CSV files into ClickHouse:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/best-practices/sparse-primary-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ ENGINE = MergeTree
-- highlight-next-line
PRIMARY KEY (UserID, URL)
ORDER BY (UserID, URL, EventTime)
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
SETTINGS index_granularity_bytes = 0, compress_primary_key = 0;
```

[//]: # (<details open>)
Expand Down Expand Up @@ -880,7 +880,7 @@ ENGINE = MergeTree
-- highlight-next-line
PRIMARY KEY (URL, UserID)
ORDER BY (URL, UserID, EventTime)
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
SETTINGS index_granularity_bytes = 0, compress_primary_key = 0;
```

Insert all 8.87 million rows from our [original table](#a-table-with-a-primary-key) into the additional table:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ CREATE TABLE db.table_local on cluster cluster (
)
ENGINE = ReplacingMergeTree
ORDER BY (id, created_at)
SETTINGS index_granularity = 8192;
SETTINGS;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SETTINGS;
;


CREATE TABLE db.table on cluster cluster (
`id` UInt64,
Expand Down Expand Up @@ -645,7 +645,7 @@ CREATE TABLE db.table_local on cluster cluster (
`item` String
)
ENGINE = MergeTree
SETTINGS index_granularity = 8192;
SETTINGS;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SETTINGS;
;


CREATE TABLE db.table on cluster cluster (
`id` UInt64,
Expand Down
1 change: 0 additions & 1 deletion docs/integrations/language-clients/python/driver-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ print(result)
# )
# ENGINE = MergeTree
# ORDER BY tuple()
# SETTINGS index_granularity = 8192

# Drop table
client.command("DROP TABLE test_command")
Expand Down
2 changes: 1 addition & 1 deletion docs/use-cases/observability/clickstack/ttl.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PARTITION BY toDate(TimestampTime)
PRIMARY KEY (ServiceName, TimestampTime)
ORDER BY (ServiceName, TimestampTime, Timestamp)
TTL TimestampTime + toIntervalDay(3)
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1
SETTINGS ttl_only_drop_parts = 1
```

Partitioning in ClickHouse allows data to be logically separated on disk according to a column or SQL expression. By separating data logically, each partition can be operated on independently e.g. deleted when it expires according to a TTL policy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,4 @@ CREATE TABLE default.`clickhouse-local-ab404c86-56cc-495b-ad1d-fb343cac3bc0event
)
ENGINE = MergeTree
ORDER BY date
SETTINGS index_granularity = 8192
```
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Query id: 248ec8e2-5bce-45b3-97d9-ed68edf445a5
)
ENGINE = MergeTree
ORDER BY id
SETTINGS index_granularity = 8192
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ CREATE TABLE system.azure_queue_log
ENGINE = MergeTree
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, event_time)
SETTINGS index_granularity = 8192
COMMENT 'Contains logging entries with the information files processes by S3Queue engine.'

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ Query id: 0ad619c3-0f2a-4ee4-8b40-c73d86e04314
ENGINE = MergeTree
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, event_time)
SETTINGS index_granularity = 8192
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ CREATE TABLE laion
)
ENGINE = MergeTree
ORDER BY id
SETTINGS index_granularity = 8192
```

CSV ファイルを ClickHouse にインポートするには、次の手順を実行します。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ ENGINE = MergeTree
-- highlight-next-line
PRIMARY KEY (UserID, URL)
ORDER BY (UserID, URL, EventTime)
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
SETTINGS index_granularity_bytes = 0, compress_primary_key = 0;
```

[//]: # "<details open>"
Expand Down Expand Up @@ -912,7 +912,7 @@ ENGINE = MergeTree
-- highlight-next-line
PRIMARY KEY (URL, UserID)
ORDER BY (URL, UserID, EventTime)
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
SETTINGS index_granularity_bytes = 0, compress_primary_key = 0;
```

[元のテーブル](#a-table-with-a-primary-key) から 887 万行すべてを別のテーブルに挿入します。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ CREATE TABLE db.table_local on cluster cluster (
)
ENGINE = ReplacingMergeTree
ORDER BY (id, created_at)
SETTINGS index_granularity = 8192;
SETTINGS;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SETTINGS;
;


CREATE TABLE db.table on cluster cluster (
`id` UInt64,
Expand Down Expand Up @@ -650,7 +650,7 @@ CREATE TABLE db.table_local on cluster cluster (
`item` String
)
ENGINE = MergeTree
SETTINGS index_granularity = 8192;
SETTINGS;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SETTINGS;
;


CREATE TABLE db.table on cluster cluster (
`id` UInt64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ print(result)
# )
# ENGINE = MergeTree {#engine-mergetree}
# ORDER BY tuple() {#order-by-tuple}
# SETTINGS index_granularity = 8192 {#settings-index_granularity-8192}

# テーブルを削除する {#drop-table}
client.command("DROP TABLE test_command")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3909,7 +3909,7 @@ SHOW CREATE TABLE t_nest;
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

Expand All @@ -3933,7 +3933,7 @@ SHOW CREATE TABLE t_nest;
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ metadata_path: /var/lib/clickhouse/store/461/461cf698-fd0b-406d-8c0
metadata_modification_time: 2021-01-25 19:14:32
dependencies_database: []
dependencies_table: []
create_table_query: CREATE TABLE base.t1 (`n` UInt64) ENGINE = MergeTree ORDER BY n SETTINGS index_granularity = 8192
engine_full: MergeTree ORDER BY n SETTINGS index_granularity = 8192
create_table_query: CREATE TABLE base.t1 (`n` UInt64) ENGINE = MergeTree ORDER BY n
engine_full: MergeTree ORDER BY n
as_select: SELECT database AS table_catalog
partition_key:
sorting_key: n
Expand Down Expand Up @@ -136,8 +136,8 @@ metadata_path: /var/lib/clickhouse/metadata/default/53r93yleapyears
metadata_modification_time: 2020-09-23 09:05:36
dependencies_database: []
dependencies_table: []
create_table_query: CREATE TABLE default.`53r93yleapyears` (`id` Int8, `febdays` Int8) ENGINE = MergeTree ORDER BY id SETTINGS index_granularity = 8192
engine_full: MergeTree ORDER BY id SETTINGS index_granularity = 8192
create_table_query: CREATE TABLE default.`53r93yleapyears` (`id` Int8, `febdays` Int8) ENGINE = MergeTree ORDER BY id
engine_full: MergeTree ORDER BY id
as_select: SELECT name AS catalog_name
partition_key:
sorting_key: id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ CREATE TABLE hilbert_numbers(
n2 UInt32
)
ENGINE=MergeTree()
ORDER BY n1 SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
ORDER BY n1 SETTINGS, index_granularity_bytes = '10Mi';
insert into hilbert_numbers (*) values(1,2);

-- 関数の引数には定数ではなくカラム名を使用します
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PARTITION BY toDate(TimestampTime)
PRIMARY KEY (ServiceName, TimestampTime)
ORDER BY (ServiceName, TimestampTime, Timestamp)
TTL TimestampTime + toIntervalDay(3)
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1
SETTINGS ttl_only_drop_parts = 1
```

ClickHouse におけるパーティション分割は、ディスク上のデータを列または SQL 式に従って論理的に分離する機能です。データを論理的に分離することで、各パーティションを独立して操作でき、たとえば TTL ポリシーに従って有効期限に達したときに削除するといったことが可能になります。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,4 @@ CREATE TABLE default.`clickhouse-local-ab404c86-56cc-495b-ad1d-fb343cac3bc0event
)
ENGINE = MergeTree
ORDER BY date
SETTINGS index_granularity = 8192
```
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Query id: 248ec8e2-5bce-45b3-97d9-ed68edf445a5
)
ENGINE = MergeTree
ORDER BY id
SETTINGS index_granularity = 8192
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ CREATE TABLE system.azure_queue_log
ENGINE = MergeTree
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, event_time)
SETTINGS index_granularity = 8192
COMMENT 'Contains logging entries with the information files processes by S3Queue engine.'

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ Query id: 0ad619c3-0f2a-4ee4-8b40-c73d86e04314
ENGINE = MergeTree
PARTITION BY toYYYYMM(event_date)
ORDER BY (event_date, event_time)
SETTINGS index_granularity = 8192
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

Expand Down
Loading