Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "arrayMap, arrayJoin or ARRAY JOIN memory usage"
linkTitle: "arrayMap, arrayJoin or ARRAY JOIN memory usage"
description: >
Why arrayMap, arrayFilter, arrayJoin use so much memory?
Why do arrayMap, arrayFilter, and arrayJoin use so much memory?
---

## arrayMap-like functions memory usage calculation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description: >-
Python main drivers/clients for ClickHouse®
---

## ClickHouse® python drivers

There are two main python drivers that can be used with ClickHouse. They all have their different set of features and use cases:

### ClickHouse driver AKA [clickhouse-driver](https://clickhouse-driver.readthedocs.io/en/latest/)
Expand Down
4 changes: 0 additions & 4 deletions content/en/altinity-kb-integrations/Spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
title: "ClickHouse® + Spark"
linkTitle: "Spark"
weight: 100
description: >-
Spark
---

## ClickHouse® + Spark

### jdbc

The trivial & natural way to talk to ClickHouse from Spark is using jdbc. There are 2 jdbc drivers:
Expand Down
82 changes: 78 additions & 4 deletions content/en/altinity-kb-integrations/altinity-cloud/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,81 @@
---
title: "Cloud Services"
linkTitle: "Cloud Services"
title: "Altinity Cloud Access Management"
linkTitle: "Altinity Cloud Access Management"
description: >
Tips and tricks for using ClickHouse® with different cloud services.
weight: 4
Enabling access_management for Altinity.Cloud databases.
weight: 5
alias: /altinity-kb-integrations/altinity-cloud
---
Organizations that want to enable administrative users in their Altinity.Cloud ClickHouse® servers can do so by enabling `access_management` manually. This allows for administrative users to be created on the specific ClickHouse Cluster.

{{% alert title="WARNING" color="warning" %}}
Modifying the ClickHouse cluster settings manually can lead to the cluster not loading or other issues. Change settings only with full consultation with an Altinity.Cloud support team member, and be ready to remove settings if they cause any disruption of service.
{{% /alert %}}

To add the `access_management` setting to an Altinity.Cloud ClickHouse Cluster:

1. Log into your Altinity.Cloud account.
1. For the cluster to modify, select **Configure -> Settings**.

{{< figure src="/assets/altinity-cloud-cluster-settings-configure.png" width="400" title="Cluster setting configure" >}}

1. From the Settings page, select **+ADD SETTING**.

{{< figure src="/assets/altinity-cloud-cluster-add-setting.png" title="Add cluster setting" >}}

1. Set the following options:
1. **Setting Type**: Select **users.d file**.
1. **Filename**: `access_management.xml`
1. **Contents**: Enter the following to allow the `clickhouse_operator` that controls the cluster through the `clickhouse-operator` the ability to set administrative options:

```xml
<clickhouse>
<users>
<admin>
<access_management>1</access_management>
</admin>
<clickhouse_operator>
<access_management>1</access_management>
</clickhouse_operator>
</users>
</clickhouse>
```

access_management=1 means that users `admin`, `clickhouse_operator` are able to create users and grant them privileges using SQL.

1. Select **OK**. The cluster will restart, and users can now be created in the cluster that can be granted administrative access.

1. If you are running ClickHouse 21.9 and above you can enable storing access management in ZooKeeper. in this case it will be automatically propagated to the cluster. This requires yet another configuration file:
1. **Setting Type**: Select **config.d file**
2. **Filename**: `user_directories.xml`
3. **Contents**:

```xml
<clickhouse>
<user_directories replace="replace">
<users_xml>
<path>/etc/clickhouse-server/users.xml</path>
</users_xml>
<replicated>
<zookeeper_path>/clickhouse/access/</zookeeper_path>
</replicated>
<local_directory>
<path>/var/lib/clickhouse/access/</path>
</local_directory>
</user_directories>
</clickhouse>
```

[//]: # (---)

[//]: # (title: "Cloud Services")

[//]: # (linkTitle: "Cloud Services")

[//]: # (description: >)

[//]: # ( Tips and tricks for using ClickHouse® with different cloud services.)

[//]: # (weight: 4)

[//]: # (---)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ linkTitle: "Altinity Cloud Access Management"
description: >
Enabling access_management for Altinity.Cloud databases.
weight: 5
alias: /altinity-kb-integrations/altinity-cloud
draft: true
---
Organizations that want to enable administrative users in their Altinity.Cloud ClickHouse® servers can do so by enabling `access_management` manually. This allows for administrative users to be created on the specific ClickHouse Cluster.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
title: "Google S3 (GCS)"
linkTitle: "Google S3 (GCS)"
description: >
"Google S3 GCS"
---

GCS with the table function - seems to work correctly for simple scenarios.

Essentially you can follow the steps from the [Migrating from Amazon S3 to Cloud Storage](https://cloud.google.com/storage/docs/aws-simple-migration).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "RabbitMQ"
linkTitle: "RabbitMQ"
description: >
RabbitMQ engine -> 24.3+
RabbitMQ engine in ClickHouse® 24.3+
---

### Settings
Expand Down
2 changes: 0 additions & 2 deletions content/en/altinity-kb-integrations/mysql-clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "MySQL"
linkTitle: "Integrating ClickHouse® with MySQL"
weight: 100
description: >-
Integrating ClickHouse® with MySQL
---

### Replication using MaterializeMySQL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ description: >
Parameterized views
---

## ClickHouse® version 23.1+

(23.1.6.42, 23.2.5.46, 23.3.1.2823)
Have inbuilt support for [parametrized views](https://clickhouse.com/docs/en/sql-reference/statements/create/view#parameterized-view):
ClickHouse® versions 23.1+ (23.1.6.42, 23.2.5.46, 23.3.1.2823)
have inbuilt support for [parametrized views](https://clickhouse.com/docs/en/sql-reference/statements/create/view#parameterized-view):

```sql
CREATE VIEW my_new_view AS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "Using array functions to mimic window-functions alike behavior"
linkTitle: "Using array functions to mimic window-functions alike behavior"
weight: 100
description: >-
Using array functions to mimic window-functions alike behavior.
---

There are some usecases when you may want to mimic window functions using Arrays - as an optimization step, or to control the memory better / use on-disk spiling, or just if you have old ClickHouse® version.
Expand Down
2 changes: 0 additions & 2 deletions content/en/altinity-kb-queries-and-syntax/datetime64.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "DateTime64"
linkTitle: "DateTime64"
weight: 100
description: >-
DateTime64 data type
---

## Subtract fractional seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "DISTINCT & GROUP BY & LIMIT 1 BY what the difference"
linkTitle: "DISTINCT & GROUP BY & LIMIT 1 BY what the difference"
weight: 100
description: >-
Page description for heading and indexes.
---

## DISTINCT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- clickhouse group by
- clickhouse memory
description: >
Learn about GROUP BY clause in ClickHouse®.
Learn about the GROUP BY clause in ClickHouse®
weight: 1
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: "JOIN optimization tricks"
linkTitle: "JOIN optimization tricks"
description: >
JOINs
---

All tests below were done with default `hash` join. ClickHouse joins are evolving rapidly and behavior varies with other join types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Row policies overhead (hiding 'removed' tenants)"
linkTitle: "Row policies overhead"
weight: 100
description: >
one more approach how to hide (delete) rows in ClickHouse®.
One more approach to hide (delete) rows in ClickHouse®
---

## No row policy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
title: "Sampling Example"
linkTitle: "Sampling Example"
description: >
ClickHouse® table sampling example
---

The most important idea about sampling that the primary index must have **LowCardinality**. (For more information, see [the Altinity Knowledge Base article on LowCardinality](../../altinity-kb-schema-design/lowcardinality) or [a ClickHouse® user\'s lessons learned from LowCardinality](https://altinity.com/blog/2020-5-20-reducing-clickhouse-storage-cost-with-the-low-cardinality-type-lessons-from-an-instana-engineer)).

The following example demonstrates how sampling can be setup correctly, and an example if it being set up incorrectly as a comparison.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
title: "Skip index bloom_filter Example"
linkTitle: "Skip index bloom_filter Example"
description: >
Example: skip index bloom_filter & array column
aliases:
/altinity-kb-queries-and-syntax/skip-indexes/example-skip-index-bloom_filter-and-array-column
---

tested with ClickHouse® 20.8.17.25

[https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree/\#table_engine-mergetree-data_skipping-indexes](https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree/#table_engine-mergetree-data_skipping-indexes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ weight: 100
description: >-
---

## Why is simple `SELECT count()` Slow in ClickHouse®?

ClickHouse is a columnar database that provides excellent performance for analytical queries. However, in some cases, a simple count query can be slow. In this article, we'll explore the reasons why this can happen and how to optimize the query.

### Three Strategies for Counting Rows in ClickHouse
Expand Down
4 changes: 0 additions & 4 deletions content/en/altinity-kb-queries-and-syntax/trace_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
title: "Collecting query execution flamegraphs using system.trace_log"
linkTitle: "trace_log"
weight: 100
description: >-
Collecting query execution flamegraph using trace_log
---

## Collecting query execution flamegraph using system.trace_log

ClickHouse® has embedded functionality to analyze the details of query performance.

It's `system.trace_log` table.
Expand Down
6 changes: 2 additions & 4 deletions content/en/altinity-kb-queries-and-syntax/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
title: "Troubleshooting"
linkTitle: "Troubleshooting"
description: >
Troubleshooting
Tips for ClickHouse® troubleshooting
---

Tips for ClickHouse® troubleshooting

### Query Execution Logging

When troubleshooting query execution in ClickHouse, one of the most useful tools is logging the query execution details. This can be controlled using the session-level setting `send_logs_level`. Here are the different log levels you can use:
When troubleshooting query execution in ClickHouse®, one of the most useful tools is logging the query execution details. This can be controlled using the session-level setting `send_logs_level`. Here are the different log levels you can use:
Possible values: `'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'`

This can be used with [clickhouse-client](https://docs.altinity.com/altinitycloud/altinity-cloud-connections/clickhouseclient/) in both interactive and non-interactive mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "MODIFY (ADD) TTL"
linkTitle: "MODIFY (ADD) TTL"
weight: 100
description: >-
What happening during MODIFY or ADD TTL query.
What happens during a MODIFY or ADD TTL query.
---

*For a general overview of TTL, see the article [Putting Things Where They Belong Using New TTL Moves](https://altinity.com/blog/2020-3-23-putting-things-where-they-belong-using-new-ttl-moves).*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Adjustable table partitioning"
linkTitle: "Adjustable table partitioning"
weight: 100
description: >-
Approach, which allow you to redefine partitioning without table creation.
An approach that allows you to redefine partitioning without table creation
---

In that example, partitioning is being calculated via `MATERIALIZED` column expression `toDate(toStartOfInterval(ts, toIntervalT(...)))`, but partition id also can be generated on application side and inserted to ClickHouse® as is.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "How to Convert Ordinary to Atomic"
linkTitle: "How to Convert Ordinary to Atomic"
weight: 100
description: >-
ClickHouse® How to Convert Ordinary to Atomic
---

## New, official way
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "CollapsingMergeTree vs ReplacingMergeTree"
linkTitle: "CollapsingMergeTree vs ReplacingMergeTree"
weight: 100
description: >-
CollapsingMergeTree vs ReplacingMergeTree.
---

## CollapsingMergeTree vs ReplacingMergeTree
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: "Merge performance and OPTIMIZE FINAL"
linkTitle: "Merge performance and OPTIMIZE FINAL"
description: >
Merge performance and OPTIMIZE FINAL DEDUPLICATE BY expr
---

## Merge Performance
Expand Down
Loading