Skip to main content

48 docs tagged with "beginner"

View All Tags

Analyze concurrent queries

Getting the TOO_MANY_SIMULTANEOUS_QUERIES error in ClickHouse? Here's how to analyze which queries are throttling your ClickHouse instance.

Change table TTLs

Want to change table TTLs in ClickHouse? Here's how you can modify the TTL of a table in ClickHouse and avoid impacting performance.

Control TTL at ingestion time

The TTL of a table can be an expression that references one or more columns; this means that the TTL for a given row will be calculated at the point of ingestion.

Create ASCII art

Ever wanted to create ASCII art from your database? If you're crazy enough to try it, here's how!

Create client sessions over HTTP

Want to know how to create a session when using the ClickHouse HTTP endpoint? Here's how to use the session_id parameter with ClickHouse.

Detect leap years

Need to detect leap years in ClickHouse? Here's a query to find years that contain 366 days instead of 365.

Drop large tables

Dropping large tables in ClickHouse, but exceeding the size limits? Here's how to drop a ClickHouse table over the default 50GB size.

Explore data from the terminal

Want to explore data using ClickHouse in the terminal? Here's how to do that with the clickhouse-client command line interface.

Filter with PREWHERE

Wondering when to use PREWHERE in ClickHouse? Here's how to optimize filtering with PREWHERE and minimize scan size in ClickHouse.

Format queries

Are your ClickHouse queries ugly? Here's how to format them in the command line with the ClickHouse query formatter.

Get the latest ClickHouse build

Want to get the latest ClickHouse build? Here's how to download the latest build to keep up with the many changes to ClickHouse.

Get your ClickHouse version

Wondering what version of ClickHouse you're running? Here's how to get your ClickHouse version with a query, in the CLI, or over the HTTP interface.

Handle integer overflows

ClickHouse doesn't perform overflow checks when casting between integer types. Here's how to handle integer overflows in ClickHouse with accurateCast.

Hard delete a table with SYNC

Want to drop a table in ClickHouse without waiting until it's deleted? Here's how to use the SYNC modifier to drop tables synchronously in ClickHouse.

Live Views

Sometimes you want ClickHouse materialized views to behave like a typical RDBMS. Here's how to use Live Views to periodically refresh ClickHouse materializations.

Monitor for server errors

Wondering how to monitor your ClickHouse server for new errors? Use the system.errors table to track all errors since the server started.

Optimize queries with Sum and Count

Sum() and Count() are the most common ClickHouse aggregations. Here's how to speed up queries in ClickHouse that use a sum and count aggregation.

Optimize single row joins

Wondering how to optimize single row joins in ClickHouse? Use a CROSS JOIN to improve join efficiency in ClickHouse.

Parse URLs

Parsing URLs with SQL can be a pain. Here's how to use ClickHouse functions to work with URLs and avoid writing custom Regex.

Select data from multiple tables

Want to get data from multiple tables in ClickHouse with a single query? Use the merge() ClickHouse function instead of UNION ALL for cleaner queries.

Show logs in the CLI

Trying to debug a problem with your ClickHouse query, but having trouble filtering through the log file? Here's how to show logs in the CLI to reduce noise when debugging ClickHouse.

Soft delete tables

Want to drop a table in ClickHouse, but worried about losing data? Here's how to "soft" delete a ClickHouse table so you can restore it in the future.

Speed up ARGMIN and ARGMAX aggregations

ClickHouse currently is not able to use the knowledge of the sort key from a table to speed up aggregations. This means that to get the ARGMIN() or ARGMAX() values from a table it will read all values even if it's sorted by that column:

Subtract two DateTime64 values

Working with datetimes in ClickHouse? Here's how to subtract values from two DateTime64 columns in a ClickHouse table without getting an error.

Swap tables

Want to swap one table for another in ClickHouse? Here are two ways to swap tables in ClickHouse using EXCHANGE TABLE or RENAME TABLE statements

When to use -If vs WHERE

Wondering the difference between the -If combinator and the WHERE statement in ClickHouse? Here are some guidelines to help you choose between -If and WHERE in ClickHouse.