SlideShare a Scribd company logo
1 of 65
Download to read offline
© 2022 Altinity, Inc.
Altinity Quickstart
for ClickHouse
Creating your first application
1
Version 2022-09 - © 2202 Altinity, Inc.
© 2022 Altinity, Inc.
Let’s make some introductions
ClickHouse support and services including Altinity.Cloud
Authors of Altinity Kubernetes Operator for ClickHouse
and other open source projects
Us
Database geeks with centuries
of experience in DBMS and
applications
You
Applications developers
looking to learn about
ClickHouse
2
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
What’s a
ClickHouse?
3
© 2022 Altinity, Inc.
Understands SQL
Runs on bare metal to cloud
Shared nothing architecture
Stores data in columns
Parallel and vectorized execution
Scales to many petabytes
Is Open source (Apache 2.0)
ClickHouse is a SQL Data Warehouse
It’s the core engine for
real-time analytics
ClickHouse
Event
Streams
ELT
Object
Storage
Interactive
Graphics
Dashboards
APIs
4
© 2022 Altinity, Inc.
What ClickHouse Is Not…
ClickHouse does not have full
ACID transactions and
updates are slow
ClickHouse is designed to read large
blocks of data for a few users
ClickHouse values speed over SQL
standards and runs anywhere
5
© 2022 Altinity, Inc.
ClickHouse stores data in columns, not rows
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Carrier FlightDate TailNum ... Cancelled Delayed
Dimensions… Measurements…
Sort
Ordering
6
© 2022 Altinity, Inc.
It compresses data and has great parallel query
59 GB
(100%)
21 MB
(.035%)
2.6 MB
(.0044%)
1.7 GB
(3%)
Read all
columns
Read 3
columns Read 3
compressed
columns
Read 3
compressed
columns over
8 threads
7
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
Installing
ClickHouse and
Connecting
8
© 2022 Altinity, Inc.
Install ClickHouse from a build repo
# Ubuntu example
sudo apt-get install -y clickhouse-server clickhouse-client
sudo systemctl start clickhouse-server
Altinity Stable Builds
Prod-ready LTS builds only
(3 years of support)
https://docs.altinity.com
ClickHouse Community Builds
Monthly builds
LTS builds every 6 months
(1 year of support)
https://clickhouse.com
9
© 2022 Altinity, Inc.
Install ClickHouse using Docker
mkdir $HOME/clickhouse-data
docker run -d --name clickhouse-server 
--ulimit nofile=262144:262144 
--volume=$HOME/clickhouse-data:/var/lib/clickhouse 
-p 8123:8123 -p 9000:9000 
clickhouse/clickhouse-server
10
Persist data
Make ports visible
Make ClickHouse happy
Altinity Stable Builds
Tag: altinity/clickhouse-server
ClickHouse Community Builds
Tag: clickhouse/clickhouse-server
© 2022 Altinity, Inc.
(Lots of vendors)
● Altinity.Cloud -- Runs in AWS and GCP as well as in user
Kubernetes clusters; tightly integrated support
● DoubleCloud – ClickHouse + Kafka + DataLens
● Aiven - Hosted ClickHouse (and many others, too)
● ClickHouse Inc – Hosted ClickHouse a la BigQuery
Install ClickHouse in the cloud
11
© 2022 Altinity, Inc.
Connecting from the command line
-- Connect to ClickHouse running locally on your laptop.
clickhouse-client
-- Same thing with explicit options.
clickhouse-client 
--host=localhost 
--port=9000 --user=default
-- Connect to a secure ClickHouse running in the Cloud.
clickhouse-client 
--host=github.demo.altinity.cloud 
--port=9440 --secure 
--user=demo --password=demo
12
© 2022 Altinity, Inc.
Connecting to built-in web UI
URL Format: http[s]://host:port/play
Example: https://github.demo.altinity.cloud:8443/play (user=demo/pw=demo)
Example: http://localhost:8123/play (user=default/pw=null)
User Password
13
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
Finding your way
around
ClickHouse
14
© 2022 Altinity, Inc.
Databases and tables
● Every ClickHouse has databases and tables
● ClickHouse databases are like folders:
○ MySQL databases
○ PostgreSQL schemas
● Every connection has a “current” database
○ Tables in the current database don’t need a database name
15
© 2022 Altinity, Inc.
Handy commands for navigation
16
SQL Command What it does
show databases List databases in ClickHouse
select currentDatabase() What’s my current database?
show tables [from name] Show tables [in a particular database]
describe table name Show the structure of table
SELECT count() FROM ontime Select from table ontime in current database
SELECT count() FROM
anotherdb.ontime
Select from table ontime in database anotherdb
© 2022 Altinity, Inc.
Selecting the database
● clickhouse-client allows you to switch between databases in a session
clickhouse101 :) use system
Ok.
● Most APIs require you to set the database in the URL.
○ HTTP:
https://rhodges_59945:<pw>@clickhouse101.demo.altinity.cloud:8443?database=system
○ JDBC: jdbc:clickhouse://clickhouse101.demo.altinity.cloud:8443/rhodges_59945
○ Python SQLAlchemy:
clickhouse+native://demo:demo@github.demo.altinity.cloud/default?secure=true
17
© 2022 Altinity, Inc.
Special databases in ClickHouse
default -- Standard database for user data in a new ClickHouse installation
config.xml: <default_database>default</default_database>
system -- Database for system tables
SHOW TABLES FROM system
┌─name───────────────────────────┐
│ aggregate_function_combinators │
│ asynchronous_metric_log │
│ asynchronous_metrics │
│ build_options │
│ clusters │
│ collations │
│ columns │
18
Your friends :)
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
Creating Your
First Table and
Loading Data
19
© 2022 Altinity, Inc.
Let’s create a table!
CREATE TABLE IF NOT EXISTS sdata (
DevId Int32,
Type String,
MDate Date,
MDatetime DateTime,
Value Float64
) ENGINE = MergeTree()
PARTITION BY toYYYYMM(MDate)
ORDER BY (DevId, MDatetime)
20
Table engine type
How to break data into
parts
How to index and sort
data in each part
Table columns
© 2022 Altinity, Inc.
Let’s insert some data the hard way…
INSERT INTO sdata VALUES
(15, 'TEMP', '2018-01-01', '2018-01-01 23:29:55', 18.0),
(15, 'TEMP', '2018-01-01', '2018-01-01 23:30:56', 18.7)
21
OK, nobody really does this.
© 2022 Altinity, Inc.
Use input formats to load raw data
Format Description
Values Normal INSERT tuples like (‘a’, 1, 35.7)
CSV, CSVWithNames Comma-separated values, CSV with column names
JSONEachRow Single JSON record per row (many JSON formats supported)
Protobuf Google Protocol Buffers format
Avro, AvroConfluent Apache Avro and Confluent/Kafka variant
Parquet Apache Parquet columnar data format
ORC Apache ORC (another columnar format from Hadoop)
* Try this: select * from system.formats
* Or this: https://clickhouse.com/docs/en/interfaces/formats/
22
© 2022 Altinity, Inc.
DevId,Type,MDate,MDatetime,Value
59,"TEMP","2018-02-01","2018-02-01 01:10:13",19.5
59,"TEMP","2018-02-01","2018-02-01 02:10:01",18.8
59,"TEMP","2018-02-01","2018-02-01 03:09:58",18.6
59,"TEMP","2018-02-01","2018-02-01 04:10:05",15.1
59,"TEMP","2018-02-01","2018-02-01 05:10:31",12.2
23
cat sdata.csv | clickhouse-client 
--database=sense 
--query='INSERT INTO sdata FORMAT CSVWithNames'
Input file sdata.csv
Use clickhouse-client to load raw data from command line
© 2022 Altinity, Inc.
Or with HTTP commands
24
#!/bin/bash
insert='INSERT%20INTO%20sense.sdata%20Format%20CSVWithNames'
curl -v "http://localhost:8123/?query=${insert}" 
--data-binary @sdata.csv
Uses HTTP POST
Read data from file
© 2022 Altinity, Inc.
Or you could insert from S3
SET max_insert_threads=32
INSERT INTO sdata
SELECT * FROM s3(
'https://s3.us-east-1.amazonaws.com/d1-alt/d1/sdata*.csv.gz',
'aws_access_key_id',
'aws_secret_access_key',
'CSVWithNames',
'DevId Int32, Type String, MDate Date, MDatetime DateTime,
Value Float64')
Parallelize!
Read multiple files
Schema (Not
needed after 22.1)
Input format
25
© 2022 Altinity, Inc.
How to update and delete rows
ALTER TABLE ontime
UPDATE UniqueCarrier = 'OO2'
WHERE UniqueCarrier = 'OO'
ALTER TABLE ontime
DELETE WHERE UniqueCarrier = 'OO2'
26
Asynchronous;
differs from
standard SQL
Can be expensive! SQL DELETE
command available
starting in 22.8!
© 2022 Altinity, Inc.
How to find out if update/delete has finished
SELECT command, is_done
FROM system.mutations
WHERE table = 'ontime'
┌─command─────────────────────────────────────────────────┬─is_done─┐
│ UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' │ 1 │
│ DELETE WHERE UniqueCarrier = 'OO2' │ 1 │
└─────────────────────────────────────────────────────────┴─────────┘
KILL mutation WHERE table = 'ontime'
27
Tracks progress of “mutations”
Cancels mutation
© 2022 Altinity, Inc.
What’s going on down there when you INSERT?
Table
Part
Index Columns
Sparse index finds rows by DevId,
MDatetime
Columns sorted
by DevId,
MDatetime
Rows in the part
all belong to
same month
Part
Index Columns
Part 28
© 2022 Altinity, Inc.
Why MergeTree? Because it merges!
Part
Index Columns
Part
Index Columns
Rewritten, Bigger Part
Index Columns
29
Update and delete also rewrite parts
© 2022 Altinity, Inc.
Top three tips for table design and data loading
● Pick a PARTITION BY that gives nice, fat partitions ( 1-300GB, < 1000
total parts)
○ Can’t decide? Partition by month.
● Use input formats to load raw data directly
● Insert large blocks of data to avoid lots of merges afterwards
○ ClickHouse will default up to 1,048,576 rows in a single part. You can increase it
to tens of millions
30
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
Selecting Data
31
© 2022 Altinity, Inc.
SELECT allows us to fetch interesting data
32
© 2022 Altinity, Inc.
Who had the most cancelled flights in 2017?
SELECT Carrier,
toYear(FlightDate) AS Year,
sum(Cancelled)/count(*) * 100. AS cancelled
FROM ontime
WHERE Year = 2017
GROUP BY Carrier, Year
HAVING cancelled > 1.0
ORDER BY cancelled DESC
LIMIT 10
Dimensions Aggregate
Range Filter
Aggregate Filter
Order of results
Max results
33
© 2022 Altinity, Inc.
Rule #1 for selecting data in ClickHouse
34
Most SQL SELECT syntax
“just works” in ClickHouse
So what’s different?
© 2022 Altinity, Inc.
If you are using ClickHouse, time is probably important
Time series == Data with built-in time ordering
35
© 2022 Altinity, Inc.
Using time dimensions in queries
SELECT
toStartOfWeek(FlightDate) AS Week,
Carrier,
count() AS Flights
FROM default.ontime_ref
WHERE FlightDate BETWEEN toDate('2015-01-01')
AND toDate('2015-06-30')
GROUP BY Week, Carrier
ORDER BY Carrier, Week
36
© 2022 Altinity, Inc.
ClickHouse has excellent date-time support
Date -- Precision to day
DateTime -- Precision to second
DateTime64 -- Precision to
nanosecond
toYear(), toMonth(), toWeek(), toDayOfWeek,
toDay(), toHour(), ...
toStartOfYear(), toStartOfQuarter(),
toStartOfMonth(), toStartOfHour(),
toStartOfMinute(), …, toStartOfInterval()
toYYYYMM()
toYYYYMMDD()
toYYYYMMDDhhmmsss()
And many more!
37
BI tools like Grafana like
DateTime values
© 2022 Altinity, Inc.
ClickHouse has a very rich set of aggregates, too
38
Standard SQL aggregation functions
● count()
● avg()
● sum()
● min()
● max()
And many more native to ClickHouse
● any()
● anyLast()
● avgWeighted()
● uniq()
● uniqExact()
● quantile()
● quantileExact()
● simpleLinearRegression()
● groupArray()
● …
© 2022 Altinity, Inc.
Drilling into GROUP BY syntax
SELECT Carrier,
toYear(FlightDate) AS Year,
count() AS TotalFlights,
sum(Cancelled) AS TotalCancelled
FROM ontime
GROUP BY Carrier, Year
Dimensions
Every thing
else must be
an aggregate
Dimensions must
be in GROUP BY
39
© 2022 Altinity, Inc.
Another example: find “Top N”with ORDER BY and LIMIT
SELECT o.Origin,
any(o.OriginCityName) AS OriginCityName,
any(o.OriginState) AS OriginState,
COUNT() as Flights
FROM ontime o
GROUP BY Origin
ORDER BY Flights DESC
LIMIT 10
Correlated
values
Measure
Dimension
40
© 2022 Altinity, Inc.
Unique aggregates in ClickHouse, example #1
SELECT toYYYYMM(time) AS month,
countIf(msg_type = 'reading') AS readings,
countIf(msg_type = 'restart') AS restarts,
avgIf(msg_type = 'reading', temperature)
AS avg
FROM test.readings_multi WHERE sensor_id = 3
GROUP BY month ORDER BY month ASC
-If Combinators
41
Aggregates from multiple entities in a single scan!
© 2022 Altinity, Inc.
Unique aggregates in ClickHouse, example #2
SELECT
sensor_id,
max(time) AS last_time,
argMaxState(message, time)
AS last_message
FROM readings_multi rm
WHERE msg_type = 'err'
AND sensor_id = 236
GROUP BY sensor_id
Find the max
time value
42
Show the
message in the
same row as the
max time
© 2022 Altinity, Inc.
How might you do #2 in “another” analytic database?
SELECT message
FROM readings_multi
WHERE (msg_type, sensor_id, time) IN
(SELECT msg_type, sensor_id, max(time)
FROM readings_multi
WHERE msg_type = 'err'
AND sensor_id = 236
GROUP BY msg_type, sensor_id)
Matching values
43
Subselect
Can be expensive in large datasets
Join
© 2022 Altinity, Inc.
JOIN combines data between tables
SELECT o.Dest,
any(a.Name) AS AirportName,
count(Dest) AS Flights
FROM ontime o
LEFT JOIN airports a ON a.IATA = toString(o.Dest)
GROUP BY Dest
ORDER BY Flights
DESC LIMIT 10
44
Join condition
Join
type
Include ontime data
even if we can’t find
the airport name
© 2022 Altinity, Inc.
Let’s look more closely at joins
. . .
IATA
. . .
airports
. . .
Dest
. . .
ontime
LEFT [OUTER] JOIN FULL [OUTER] JOIN
RIGHT [OUTER] JOIN
All ontime rows, plus
matching airport rows
All airport rows, plus
matching ontime rows
[INNER] JOIN
Only rows that match on both sides
Matching rows, plus non-matching
rows from both sides
CROSS JOIN
Matches all rows with each
other. Aka “cartesian join”
SELECT . . . FROM ontime o JOIN airports a ON a.IATA = toString(o.Dest)
45
Left Right
© 2022 Altinity, Inc.
You can check this yourself with sample tables
Table Left
id value
1 Left
2 Left
Table Right
id value
2 Right
3 Right
SELECT l.id, l.value, r.id, r.value
FROM left AS l INNER JOIN right AS r ON l.id = r.id
Id value id value
2 Left 2 Right
Id value id value
1 Left 0 -
2 Left 2 Right
Id value id value
2 Left 2 Right
0 - 3 Right
Id value id value
1 Left 0 -
2 Left 2 Right
0 - 3 Right
[INNER] JOIN
LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN
46
© 2022 Altinity, Inc.
How does ClickHouse process a query with a join?
Left Side
Table
(Big)
Merged
Result
Filter
Right Side
Table
(Small)
In-RAM
Hash
Table
Load the right side table
Scan left side table in
parallel, computing
aggregates and adding
joined data
Merge and sort results
47
© 2022 Altinity, Inc.
Top tips for querying data in ClickHouse
● Use time functions to pull out data grouped by time intervals
● Use aggregates to summarize data inside ClickHouse
○ Use -If combinators and others to avoid multiple scans
● The big table always goes on the LEFT side of the join
○ ClickHouse cannot decide the join order [yet] for you
48
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
ClickHouse
Performance
Self-Defense
49
© 2022 Altinity, Inc.
ClickHouse performance in four easy steps
● Add more CPU
● Limit columns and rows in queries
● Fix table design
● Store data more efficiently on disk (or SSD)
50
© 2022 Altinity, Inc.
Add more compute using max_threads property
SELECT toYear(FlightDate) year,
sum(Cancelled)/count(*) cancelled,
sum(DepDel15)/count(*) delayed_15
FROM airline.ontime
GROUP BY year ORDER BY year LIMIT 10
SET max_threads = 2
SET max_threads = 4
. . .
max_threads defaults to half
the number of CPU cores
51
© 2022 Altinity, Inc.
(Log messages)
Selected 2 parts by date,
2 parts by key,
73 marks to read from 2 ranges
Read fewer rows to get better performance
SELECT
FlightDate,
count(*) AS total_flights,
sum(Cancelled) / count(*) AS cancelled,
sum(DepDel15) / count(*) AS delayed_15
FROM airline.ontime
WHERE (FlightDate >= toDate('2016-01-01'))
AND (FlightDate <= toDate('2016-02-10'))
GROUP BY FlightDate
52
© 2022 Altinity, Inc.
Understanding what’s going on in MergeTree
/var/lib/clickhouse/data/airline/ontime
2017-07-01 AA
2017-07-01 EV
2017-07-01 UA
2017-07-02 AA
...
primary.idx
|
|
|
|
.mrk .bin
20170701_20170731_355_355_2/
(FlightDate, Carrier...) ActualElapsedTime Airline AirlineID...
|
|
|
|
.mrk .bin
|
|
|
|
.mrk .bin
Granule
Compressed
Block
Mark
53
© 2022 Altinity, Inc.
CREATE TABLE ontime
(
`Year` UInt16,
`Quarter` UInt8, . . .
)
ENGINE = MergeTree
PARTITION BY Year
PRIMARY KEY (Carrier, FlightDate)
ORDER BY (Carrier, FlightDate, DepTime)
Ensure table design is optimal for queries
54
Results in ~125 parts for
this dataset, avg 107MB
per part
Use columns you filter on
Order columns by increasing cardinality* left to right
*Cardinality = How many unique values in column
© 2022 Altinity, Inc.
Finding out column compression level
SELECT
formatReadableSize(sum(data_compressed_bytes)) AS tc,
formatReadableSize(sum(data_uncompressed_bytes)) AS tu,
sum(data_compressed_bytes) / sum(data_uncompressed_bytes) AS ratio
FROM system.columns
WHERE database = currentDatabase()
AND (table = 'ontime')
AND (name = 'TailNum')
┌─tc────────┬─tu────────┬──────────────ratio─┐
│ 19.33 MiB │ 37.80 MiB │ 0.5112778354359176 │
└───────────┴───────────┴────────────────────┘
55
© 2022 Altinity, Inc.
Make a column smaller with compression
┌─TailNum─┐
│ N3HYAA │
│ N377AA │
│ N377AA │
│ N922AA │
│ N862AA │
│ N3EEAA │
│ N536AA │
│ N665AA │
│ N862AA │
│ N936AA │
│ N4YBAA │
└─────────┘
56
Compression reduces a
string of bits to a different
and hopefully smaller
string of bits
LZ4 Compression
Fast to compress and
decompress. Default for
ClickHouse
ZSTD Compression
Slower to compress but
generally smaller than LZ4.
You have to ask for it
© 2022 Altinity, Inc.
Codecs reduce data before compression
N862AA
Value
LowCardinality
encoding
ZSTD(1)
compression
351
Smaller Value
Something
very small!
Turns each
string into an
integer
Aka Dictionary
Encoding
6 bytes 2 bytes
57
© 2022 Altinity, Inc.
Overview of encodings
Name Best for
LowCardinality Strings with fewer than 10K values
Delta Time series
Double Delta Increasing counters
Gorilla Gauge data (bounces around mean)
T64 Integers other than random hashes
Codec compression may vary between LZ4 and ZSTD
58
© 2022 Altinity, Inc.
How to add codecs and change compression
ALTER TABLE ontime
MODIFY COLUMN TailNum LowCardinality(String)
CODEC(ZSTD(1))
ALTER TABLE ontime
MODIFY COLUMN Year CODEC(DoubleDelta, ZSTD(1))
-- Force ClickHouse to change data
ALTER TABLE ontime UPDATE TailNum = TailNum, Year = Year
WHERE 1
59
© 2022 Altinity, Inc.
Effect of codec and compression changes
60
© 2022 Altinity, Inc.
© 2022 Altinity, Inc.
Getting started
on applications
61
© 2022 Altinity, Inc.
Where is the software? (All open source!)
62
Event streaming
● Apache Kafka
● Apache Pulsar
● Vectorized Redpanda
ELT
● Apache Airflow
● Rudderstack
Rendering/Display
● Apache Superset
● Cube.js
● Grafana
Client Libraries
● C++ - ClickHouse CPP
● Golang - ClickHouse Go
● Java - ClickHouse JDBC
● Javascript/Node.js - Apla
● ODBC - ODBC Driver for ClickHouse
● Python - ClickHouse Driver, ClickHouse
SQLAlchemy
More client library links HERE
Kubernetes
● Altinity Operator for ClickHouse
© 2022 Altinity, Inc.
Where is the documentation?
ClickHouse official docs – https://clickhouse.com/docs/
Altinity Blog – https://altinity.com/blog/
Altinity Youtube Channel –
https://www.youtube.com/channel/UCE3Y2lDKl_ZfjaCrh62onYA
Altinity Knowledge Base – https://kb.altinity.com/
Meetups, other blogs, and external resources. Use your powers of Search!
63
© 2022 Altinity, Inc.
Where can I get help?
Telegram - ClickHouse Channel
Slack
● ClickHouse Public Workspace - clickhousedb.slack.com
● Altinity Public Workspace - altinitydbworkspace.slack.com
Education - Altinity ClickHouse Training
Support - Altinity offers support for ClickHouse in all environments
64
© 2022 Altinity, Inc.
Thank you and
good luck!
Website: https://altinity.com
Email: info@altinity.com
Slack: altinitydbworkspace.slack.com
65
Altinity.Cloud
Altinity Support
Altinity Stable
Builds
We’re hiring!

More Related Content

What's hot

What's hot (20)

ClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic ContinuesClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic Continues
 
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
 
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UIData Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
 
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
ClickHouse Data Warehouse 101: The First Billion Rows, by Alexander Zaitsev a...
 
ClickHouse Keeper
ClickHouse KeeperClickHouse Keeper
ClickHouse Keeper
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
 
Webinar: Strength in Numbers: Introduction to ClickHouse Cluster Performance
Webinar: Strength in Numbers: Introduction to ClickHouse Cluster PerformanceWebinar: Strength in Numbers: Introduction to ClickHouse Cluster Performance
Webinar: Strength in Numbers: Introduction to ClickHouse Cluster Performance
 
Your first ClickHouse data warehouse
Your first ClickHouse data warehouseYour first ClickHouse data warehouse
Your first ClickHouse data warehouse
 
A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides A Day in the Life of a ClickHouse Query Webinar Slides
A Day in the Life of a ClickHouse Query Webinar Slides
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
A day in the life of a click house query
A day in the life of a click house queryA day in the life of a click house query
A day in the life of a click house query
 
ClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Features for Advanced Users, by Aleksei MilovidovClickHouse Features for Advanced Users, by Aleksei Milovidov
ClickHouse Features for Advanced Users, by Aleksei Milovidov
 
Altinity Quickstart for ClickHouse
Altinity Quickstart for ClickHouseAltinity Quickstart for ClickHouse
Altinity Quickstart for ClickHouse
 
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTOClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
 
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
 
Better than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouseBetter than you think: Handling JSON data in ClickHouse
Better than you think: Handling JSON data in ClickHouse
 
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEOTricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
Tricks every ClickHouse designer should know, by Robert Hodges, Altinity CEO
 
InnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick FiguresInnoDB Locking Explained with Stick Figures
InnoDB Locking Explained with Stick Figures
 
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
 
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
 

Similar to Altinity Quickstart for ClickHouse-2202-09-15.pdf

Similar to Altinity Quickstart for ClickHouse-2202-09-15.pdf (20)

Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdfAltinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
Altinity Webinar: Introduction to Altinity.Cloud-Platform for Real-Time Data.pdf
 
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
Building High Performance Apps with Altinity Stable Builds for ClickHouse | A...
 
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdfOwn your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
Own your ClickHouse data with Altinity.Cloud Anywhere-2023-01-17.pdf
 
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
 
Taming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using TelegrafTaming the Tiger: Tips and Tricks for Using Telegraf
Taming the Tiger: Tips and Tricks for Using Telegraf
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
citus™ iot ecosystem
citus™ iot ecosystemcitus™ iot ecosystem
citus™ iot ecosystem
 
Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...
Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...
Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...
 
Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM Maximize the power of OSGi in AEM
Maximize the power of OSGi in AEM
 
Pivotal Platform - December Release A First Look
Pivotal Platform - December Release A First LookPivotal Platform - December Release A First Look
Pivotal Platform - December Release A First Look
 
State of Steeltoe 2020
State of Steeltoe 2020State of Steeltoe 2020
State of Steeltoe 2020
 
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEODangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
 
Oracle Autonomous Data Warehouse Cloud and Data Visualization
Oracle Autonomous Data Warehouse Cloud and Data VisualizationOracle Autonomous Data Warehouse Cloud and Data Visualization
Oracle Autonomous Data Warehouse Cloud and Data Visualization
 
You Can Be Cloud Native, Too
You Can Be Cloud Native, TooYou Can Be Cloud Native, Too
You Can Be Cloud Native, Too
 
Dart on Arm - Flutter Bangalore June 2021
Dart on Arm - Flutter Bangalore June 2021Dart on Arm - Flutter Bangalore June 2021
Dart on Arm - Flutter Bangalore June 2021
 
Intro to Git Devnet-1080 Cisco Live 2018
Intro to Git Devnet-1080 Cisco Live 2018Intro to Git Devnet-1080 Cisco Live 2018
Intro to Git Devnet-1080 Cisco Live 2018
 
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
How to build an ETL pipeline with Apache Beam on Google Cloud DataflowHow to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
How to build an ETL pipeline with Apache Beam on Google Cloud Dataflow
 
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha BigData How we figured out we had a SRE team at ...
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEOClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 

More from Altinity Ltd

More from Altinity Ltd (20)

Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptxBuilding an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
Building an Analytic Extension to MySQL with ClickHouse and Open Source.pptx
 
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
Cloud Native ClickHouse at Scale--Using the Altinity Kubernetes Operator-2022...
 
Building an Analytic Extension to MySQL with ClickHouse and Open Source
Building an Analytic Extension to MySQL with ClickHouse and Open SourceBuilding an Analytic Extension to MySQL with ClickHouse and Open Source
Building an Analytic Extension to MySQL with ClickHouse and Open Source
 
Fun with ClickHouse Window Functions-2021-08-19.pdf
Fun with ClickHouse Window Functions-2021-08-19.pdfFun with ClickHouse Window Functions-2021-08-19.pdf
Fun with ClickHouse Window Functions-2021-08-19.pdf
 
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdfCloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
Cloud Native Data Warehouses - Intro to ClickHouse on Kubernetes-2021-07.pdf
 
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
 
ClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom AppsClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom Apps
 
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
Building a Real-Time Analytics Application with  Apache Pulsar and Apache PinotBuilding a Real-Time Analytics Application with  Apache Pulsar and Apache Pinot
Building a Real-Time Analytics Application with Apache Pulsar and Apache Pinot
 
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
OSA Con 2022 - What Data Engineering Can Learn from Frontend Engineering - Pe...
 
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdfOSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
OSA Con 2022 - Welcome to OSA CON Version 2022 - Robert Hodges - Altinity.pdf
 
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
OSA Con 2022 - Using ClickHouse Database to Power Analytics and Customer Enga...
 
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
OSA Con 2022 - Tips and Tricks to Keep Your Queries under 100ms with ClickHou...
 
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
OSA Con 2022 - The Open Source Analytic Universe, Version 2022 - Robert Hodge...
 
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
OSA Con 2022 - Switching Jaeger Distributed Tracing to ClickHouse to Enable A...
 
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
OSA Con 2022 - Streaming Data Made Easy - Tim Spann & David Kjerrumgaard - St...
 
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdfOSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
OSA Con 2022 - State of Open Source Databases - Peter Zaitsev - Percona.pdf
 
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
 
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
OSA Con 2022 - Signal Correlation, the Ho11y Grail - Michael Hausenblas - AWS...
 
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdfOSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
OSA Con 2022 - Scaling your Pandas Analytics with Modin - Doris Lee - Ponder.pdf
 
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
OSA Con 2022 - Quick Reflexes_ Building Real-Time Data Analytics with Redpand...
 

Recently uploaded

Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
vexqp
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 

Recently uploaded (20)

7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptxThe-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
Data Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdfData Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdf
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Harnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptxHarnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptx
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 

Altinity Quickstart for ClickHouse-2202-09-15.pdf

  • 1. © 2022 Altinity, Inc. Altinity Quickstart for ClickHouse Creating your first application 1 Version 2022-09 - © 2202 Altinity, Inc.
  • 2. © 2022 Altinity, Inc. Let’s make some introductions ClickHouse support and services including Altinity.Cloud Authors of Altinity Kubernetes Operator for ClickHouse and other open source projects Us Database geeks with centuries of experience in DBMS and applications You Applications developers looking to learn about ClickHouse 2
  • 3. © 2022 Altinity, Inc. © 2022 Altinity, Inc. What’s a ClickHouse? 3
  • 4. © 2022 Altinity, Inc. Understands SQL Runs on bare metal to cloud Shared nothing architecture Stores data in columns Parallel and vectorized execution Scales to many petabytes Is Open source (Apache 2.0) ClickHouse is a SQL Data Warehouse It’s the core engine for real-time analytics ClickHouse Event Streams ELT Object Storage Interactive Graphics Dashboards APIs 4
  • 5. © 2022 Altinity, Inc. What ClickHouse Is Not… ClickHouse does not have full ACID transactions and updates are slow ClickHouse is designed to read large blocks of data for a few users ClickHouse values speed over SQL standards and runs anywhere 5
  • 6. © 2022 Altinity, Inc. ClickHouse stores data in columns, not rows Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Carrier FlightDate TailNum ... Cancelled Delayed Dimensions… Measurements… Sort Ordering 6
  • 7. © 2022 Altinity, Inc. It compresses data and has great parallel query 59 GB (100%) 21 MB (.035%) 2.6 MB (.0044%) 1.7 GB (3%) Read all columns Read 3 columns Read 3 compressed columns Read 3 compressed columns over 8 threads 7
  • 8. © 2022 Altinity, Inc. © 2022 Altinity, Inc. Installing ClickHouse and Connecting 8
  • 9. © 2022 Altinity, Inc. Install ClickHouse from a build repo # Ubuntu example sudo apt-get install -y clickhouse-server clickhouse-client sudo systemctl start clickhouse-server Altinity Stable Builds Prod-ready LTS builds only (3 years of support) https://docs.altinity.com ClickHouse Community Builds Monthly builds LTS builds every 6 months (1 year of support) https://clickhouse.com 9
  • 10. © 2022 Altinity, Inc. Install ClickHouse using Docker mkdir $HOME/clickhouse-data docker run -d --name clickhouse-server --ulimit nofile=262144:262144 --volume=$HOME/clickhouse-data:/var/lib/clickhouse -p 8123:8123 -p 9000:9000 clickhouse/clickhouse-server 10 Persist data Make ports visible Make ClickHouse happy Altinity Stable Builds Tag: altinity/clickhouse-server ClickHouse Community Builds Tag: clickhouse/clickhouse-server
  • 11. © 2022 Altinity, Inc. (Lots of vendors) ● Altinity.Cloud -- Runs in AWS and GCP as well as in user Kubernetes clusters; tightly integrated support ● DoubleCloud – ClickHouse + Kafka + DataLens ● Aiven - Hosted ClickHouse (and many others, too) ● ClickHouse Inc – Hosted ClickHouse a la BigQuery Install ClickHouse in the cloud 11
  • 12. © 2022 Altinity, Inc. Connecting from the command line -- Connect to ClickHouse running locally on your laptop. clickhouse-client -- Same thing with explicit options. clickhouse-client --host=localhost --port=9000 --user=default -- Connect to a secure ClickHouse running in the Cloud. clickhouse-client --host=github.demo.altinity.cloud --port=9440 --secure --user=demo --password=demo 12
  • 13. © 2022 Altinity, Inc. Connecting to built-in web UI URL Format: http[s]://host:port/play Example: https://github.demo.altinity.cloud:8443/play (user=demo/pw=demo) Example: http://localhost:8123/play (user=default/pw=null) User Password 13
  • 14. © 2022 Altinity, Inc. © 2022 Altinity, Inc. Finding your way around ClickHouse 14
  • 15. © 2022 Altinity, Inc. Databases and tables ● Every ClickHouse has databases and tables ● ClickHouse databases are like folders: ○ MySQL databases ○ PostgreSQL schemas ● Every connection has a “current” database ○ Tables in the current database don’t need a database name 15
  • 16. © 2022 Altinity, Inc. Handy commands for navigation 16 SQL Command What it does show databases List databases in ClickHouse select currentDatabase() What’s my current database? show tables [from name] Show tables [in a particular database] describe table name Show the structure of table SELECT count() FROM ontime Select from table ontime in current database SELECT count() FROM anotherdb.ontime Select from table ontime in database anotherdb
  • 17. © 2022 Altinity, Inc. Selecting the database ● clickhouse-client allows you to switch between databases in a session clickhouse101 :) use system Ok. ● Most APIs require you to set the database in the URL. ○ HTTP: https://rhodges_59945:<pw>@clickhouse101.demo.altinity.cloud:8443?database=system ○ JDBC: jdbc:clickhouse://clickhouse101.demo.altinity.cloud:8443/rhodges_59945 ○ Python SQLAlchemy: clickhouse+native://demo:demo@github.demo.altinity.cloud/default?secure=true 17
  • 18. © 2022 Altinity, Inc. Special databases in ClickHouse default -- Standard database for user data in a new ClickHouse installation config.xml: <default_database>default</default_database> system -- Database for system tables SHOW TABLES FROM system ┌─name───────────────────────────┐ │ aggregate_function_combinators │ │ asynchronous_metric_log │ │ asynchronous_metrics │ │ build_options │ │ clusters │ │ collations │ │ columns │ 18 Your friends :)
  • 19. © 2022 Altinity, Inc. © 2022 Altinity, Inc. Creating Your First Table and Loading Data 19
  • 20. © 2022 Altinity, Inc. Let’s create a table! CREATE TABLE IF NOT EXISTS sdata ( DevId Int32, Type String, MDate Date, MDatetime DateTime, Value Float64 ) ENGINE = MergeTree() PARTITION BY toYYYYMM(MDate) ORDER BY (DevId, MDatetime) 20 Table engine type How to break data into parts How to index and sort data in each part Table columns
  • 21. © 2022 Altinity, Inc. Let’s insert some data the hard way… INSERT INTO sdata VALUES (15, 'TEMP', '2018-01-01', '2018-01-01 23:29:55', 18.0), (15, 'TEMP', '2018-01-01', '2018-01-01 23:30:56', 18.7) 21 OK, nobody really does this.
  • 22. © 2022 Altinity, Inc. Use input formats to load raw data Format Description Values Normal INSERT tuples like (‘a’, 1, 35.7) CSV, CSVWithNames Comma-separated values, CSV with column names JSONEachRow Single JSON record per row (many JSON formats supported) Protobuf Google Protocol Buffers format Avro, AvroConfluent Apache Avro and Confluent/Kafka variant Parquet Apache Parquet columnar data format ORC Apache ORC (another columnar format from Hadoop) * Try this: select * from system.formats * Or this: https://clickhouse.com/docs/en/interfaces/formats/ 22
  • 23. © 2022 Altinity, Inc. DevId,Type,MDate,MDatetime,Value 59,"TEMP","2018-02-01","2018-02-01 01:10:13",19.5 59,"TEMP","2018-02-01","2018-02-01 02:10:01",18.8 59,"TEMP","2018-02-01","2018-02-01 03:09:58",18.6 59,"TEMP","2018-02-01","2018-02-01 04:10:05",15.1 59,"TEMP","2018-02-01","2018-02-01 05:10:31",12.2 23 cat sdata.csv | clickhouse-client --database=sense --query='INSERT INTO sdata FORMAT CSVWithNames' Input file sdata.csv Use clickhouse-client to load raw data from command line
  • 24. © 2022 Altinity, Inc. Or with HTTP commands 24 #!/bin/bash insert='INSERT%20INTO%20sense.sdata%20Format%20CSVWithNames' curl -v "http://localhost:8123/?query=${insert}" --data-binary @sdata.csv Uses HTTP POST Read data from file
  • 25. © 2022 Altinity, Inc. Or you could insert from S3 SET max_insert_threads=32 INSERT INTO sdata SELECT * FROM s3( 'https://s3.us-east-1.amazonaws.com/d1-alt/d1/sdata*.csv.gz', 'aws_access_key_id', 'aws_secret_access_key', 'CSVWithNames', 'DevId Int32, Type String, MDate Date, MDatetime DateTime, Value Float64') Parallelize! Read multiple files Schema (Not needed after 22.1) Input format 25
  • 26. © 2022 Altinity, Inc. How to update and delete rows ALTER TABLE ontime UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' ALTER TABLE ontime DELETE WHERE UniqueCarrier = 'OO2' 26 Asynchronous; differs from standard SQL Can be expensive! SQL DELETE command available starting in 22.8!
  • 27. © 2022 Altinity, Inc. How to find out if update/delete has finished SELECT command, is_done FROM system.mutations WHERE table = 'ontime' ┌─command─────────────────────────────────────────────────┬─is_done─┐ │ UPDATE UniqueCarrier = 'OO2' WHERE UniqueCarrier = 'OO' │ 1 │ │ DELETE WHERE UniqueCarrier = 'OO2' │ 1 │ └─────────────────────────────────────────────────────────┴─────────┘ KILL mutation WHERE table = 'ontime' 27 Tracks progress of “mutations” Cancels mutation
  • 28. © 2022 Altinity, Inc. What’s going on down there when you INSERT? Table Part Index Columns Sparse index finds rows by DevId, MDatetime Columns sorted by DevId, MDatetime Rows in the part all belong to same month Part Index Columns Part 28
  • 29. © 2022 Altinity, Inc. Why MergeTree? Because it merges! Part Index Columns Part Index Columns Rewritten, Bigger Part Index Columns 29 Update and delete also rewrite parts
  • 30. © 2022 Altinity, Inc. Top three tips for table design and data loading ● Pick a PARTITION BY that gives nice, fat partitions ( 1-300GB, < 1000 total parts) ○ Can’t decide? Partition by month. ● Use input formats to load raw data directly ● Insert large blocks of data to avoid lots of merges afterwards ○ ClickHouse will default up to 1,048,576 rows in a single part. You can increase it to tens of millions 30
  • 31. © 2022 Altinity, Inc. © 2022 Altinity, Inc. Selecting Data 31
  • 32. © 2022 Altinity, Inc. SELECT allows us to fetch interesting data 32
  • 33. © 2022 Altinity, Inc. Who had the most cancelled flights in 2017? SELECT Carrier, toYear(FlightDate) AS Year, sum(Cancelled)/count(*) * 100. AS cancelled FROM ontime WHERE Year = 2017 GROUP BY Carrier, Year HAVING cancelled > 1.0 ORDER BY cancelled DESC LIMIT 10 Dimensions Aggregate Range Filter Aggregate Filter Order of results Max results 33
  • 34. © 2022 Altinity, Inc. Rule #1 for selecting data in ClickHouse 34 Most SQL SELECT syntax “just works” in ClickHouse So what’s different?
  • 35. © 2022 Altinity, Inc. If you are using ClickHouse, time is probably important Time series == Data with built-in time ordering 35
  • 36. © 2022 Altinity, Inc. Using time dimensions in queries SELECT toStartOfWeek(FlightDate) AS Week, Carrier, count() AS Flights FROM default.ontime_ref WHERE FlightDate BETWEEN toDate('2015-01-01') AND toDate('2015-06-30') GROUP BY Week, Carrier ORDER BY Carrier, Week 36
  • 37. © 2022 Altinity, Inc. ClickHouse has excellent date-time support Date -- Precision to day DateTime -- Precision to second DateTime64 -- Precision to nanosecond toYear(), toMonth(), toWeek(), toDayOfWeek, toDay(), toHour(), ... toStartOfYear(), toStartOfQuarter(), toStartOfMonth(), toStartOfHour(), toStartOfMinute(), …, toStartOfInterval() toYYYYMM() toYYYYMMDD() toYYYYMMDDhhmmsss() And many more! 37 BI tools like Grafana like DateTime values
  • 38. © 2022 Altinity, Inc. ClickHouse has a very rich set of aggregates, too 38 Standard SQL aggregation functions ● count() ● avg() ● sum() ● min() ● max() And many more native to ClickHouse ● any() ● anyLast() ● avgWeighted() ● uniq() ● uniqExact() ● quantile() ● quantileExact() ● simpleLinearRegression() ● groupArray() ● …
  • 39. © 2022 Altinity, Inc. Drilling into GROUP BY syntax SELECT Carrier, toYear(FlightDate) AS Year, count() AS TotalFlights, sum(Cancelled) AS TotalCancelled FROM ontime GROUP BY Carrier, Year Dimensions Every thing else must be an aggregate Dimensions must be in GROUP BY 39
  • 40. © 2022 Altinity, Inc. Another example: find “Top N”with ORDER BY and LIMIT SELECT o.Origin, any(o.OriginCityName) AS OriginCityName, any(o.OriginState) AS OriginState, COUNT() as Flights FROM ontime o GROUP BY Origin ORDER BY Flights DESC LIMIT 10 Correlated values Measure Dimension 40
  • 41. © 2022 Altinity, Inc. Unique aggregates in ClickHouse, example #1 SELECT toYYYYMM(time) AS month, countIf(msg_type = 'reading') AS readings, countIf(msg_type = 'restart') AS restarts, avgIf(msg_type = 'reading', temperature) AS avg FROM test.readings_multi WHERE sensor_id = 3 GROUP BY month ORDER BY month ASC -If Combinators 41 Aggregates from multiple entities in a single scan!
  • 42. © 2022 Altinity, Inc. Unique aggregates in ClickHouse, example #2 SELECT sensor_id, max(time) AS last_time, argMaxState(message, time) AS last_message FROM readings_multi rm WHERE msg_type = 'err' AND sensor_id = 236 GROUP BY sensor_id Find the max time value 42 Show the message in the same row as the max time
  • 43. © 2022 Altinity, Inc. How might you do #2 in “another” analytic database? SELECT message FROM readings_multi WHERE (msg_type, sensor_id, time) IN (SELECT msg_type, sensor_id, max(time) FROM readings_multi WHERE msg_type = 'err' AND sensor_id = 236 GROUP BY msg_type, sensor_id) Matching values 43 Subselect Can be expensive in large datasets Join
  • 44. © 2022 Altinity, Inc. JOIN combines data between tables SELECT o.Dest, any(a.Name) AS AirportName, count(Dest) AS Flights FROM ontime o LEFT JOIN airports a ON a.IATA = toString(o.Dest) GROUP BY Dest ORDER BY Flights DESC LIMIT 10 44 Join condition Join type Include ontime data even if we can’t find the airport name
  • 45. © 2022 Altinity, Inc. Let’s look more closely at joins . . . IATA . . . airports . . . Dest . . . ontime LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN All ontime rows, plus matching airport rows All airport rows, plus matching ontime rows [INNER] JOIN Only rows that match on both sides Matching rows, plus non-matching rows from both sides CROSS JOIN Matches all rows with each other. Aka “cartesian join” SELECT . . . FROM ontime o JOIN airports a ON a.IATA = toString(o.Dest) 45 Left Right
  • 46. © 2022 Altinity, Inc. You can check this yourself with sample tables Table Left id value 1 Left 2 Left Table Right id value 2 Right 3 Right SELECT l.id, l.value, r.id, r.value FROM left AS l INNER JOIN right AS r ON l.id = r.id Id value id value 2 Left 2 Right Id value id value 1 Left 0 - 2 Left 2 Right Id value id value 2 Left 2 Right 0 - 3 Right Id value id value 1 Left 0 - 2 Left 2 Right 0 - 3 Right [INNER] JOIN LEFT [OUTER] JOIN FULL [OUTER] JOIN RIGHT [OUTER] JOIN 46
  • 47. © 2022 Altinity, Inc. How does ClickHouse process a query with a join? Left Side Table (Big) Merged Result Filter Right Side Table (Small) In-RAM Hash Table Load the right side table Scan left side table in parallel, computing aggregates and adding joined data Merge and sort results 47
  • 48. © 2022 Altinity, Inc. Top tips for querying data in ClickHouse ● Use time functions to pull out data grouped by time intervals ● Use aggregates to summarize data inside ClickHouse ○ Use -If combinators and others to avoid multiple scans ● The big table always goes on the LEFT side of the join ○ ClickHouse cannot decide the join order [yet] for you 48
  • 49. © 2022 Altinity, Inc. © 2022 Altinity, Inc. ClickHouse Performance Self-Defense 49
  • 50. © 2022 Altinity, Inc. ClickHouse performance in four easy steps ● Add more CPU ● Limit columns and rows in queries ● Fix table design ● Store data more efficiently on disk (or SSD) 50
  • 51. © 2022 Altinity, Inc. Add more compute using max_threads property SELECT toYear(FlightDate) year, sum(Cancelled)/count(*) cancelled, sum(DepDel15)/count(*) delayed_15 FROM airline.ontime GROUP BY year ORDER BY year LIMIT 10 SET max_threads = 2 SET max_threads = 4 . . . max_threads defaults to half the number of CPU cores 51
  • 52. © 2022 Altinity, Inc. (Log messages) Selected 2 parts by date, 2 parts by key, 73 marks to read from 2 ranges Read fewer rows to get better performance SELECT FlightDate, count(*) AS total_flights, sum(Cancelled) / count(*) AS cancelled, sum(DepDel15) / count(*) AS delayed_15 FROM airline.ontime WHERE (FlightDate >= toDate('2016-01-01')) AND (FlightDate <= toDate('2016-02-10')) GROUP BY FlightDate 52
  • 53. © 2022 Altinity, Inc. Understanding what’s going on in MergeTree /var/lib/clickhouse/data/airline/ontime 2017-07-01 AA 2017-07-01 EV 2017-07-01 UA 2017-07-02 AA ... primary.idx | | | | .mrk .bin 20170701_20170731_355_355_2/ (FlightDate, Carrier...) ActualElapsedTime Airline AirlineID... | | | | .mrk .bin | | | | .mrk .bin Granule Compressed Block Mark 53
  • 54. © 2022 Altinity, Inc. CREATE TABLE ontime ( `Year` UInt16, `Quarter` UInt8, . . . ) ENGINE = MergeTree PARTITION BY Year PRIMARY KEY (Carrier, FlightDate) ORDER BY (Carrier, FlightDate, DepTime) Ensure table design is optimal for queries 54 Results in ~125 parts for this dataset, avg 107MB per part Use columns you filter on Order columns by increasing cardinality* left to right *Cardinality = How many unique values in column
  • 55. © 2022 Altinity, Inc. Finding out column compression level SELECT formatReadableSize(sum(data_compressed_bytes)) AS tc, formatReadableSize(sum(data_uncompressed_bytes)) AS tu, sum(data_compressed_bytes) / sum(data_uncompressed_bytes) AS ratio FROM system.columns WHERE database = currentDatabase() AND (table = 'ontime') AND (name = 'TailNum') ┌─tc────────┬─tu────────┬──────────────ratio─┐ │ 19.33 MiB │ 37.80 MiB │ 0.5112778354359176 │ └───────────┴───────────┴────────────────────┘ 55
  • 56. © 2022 Altinity, Inc. Make a column smaller with compression ┌─TailNum─┐ │ N3HYAA │ │ N377AA │ │ N377AA │ │ N922AA │ │ N862AA │ │ N3EEAA │ │ N536AA │ │ N665AA │ │ N862AA │ │ N936AA │ │ N4YBAA │ └─────────┘ 56 Compression reduces a string of bits to a different and hopefully smaller string of bits LZ4 Compression Fast to compress and decompress. Default for ClickHouse ZSTD Compression Slower to compress but generally smaller than LZ4. You have to ask for it
  • 57. © 2022 Altinity, Inc. Codecs reduce data before compression N862AA Value LowCardinality encoding ZSTD(1) compression 351 Smaller Value Something very small! Turns each string into an integer Aka Dictionary Encoding 6 bytes 2 bytes 57
  • 58. © 2022 Altinity, Inc. Overview of encodings Name Best for LowCardinality Strings with fewer than 10K values Delta Time series Double Delta Increasing counters Gorilla Gauge data (bounces around mean) T64 Integers other than random hashes Codec compression may vary between LZ4 and ZSTD 58
  • 59. © 2022 Altinity, Inc. How to add codecs and change compression ALTER TABLE ontime MODIFY COLUMN TailNum LowCardinality(String) CODEC(ZSTD(1)) ALTER TABLE ontime MODIFY COLUMN Year CODEC(DoubleDelta, ZSTD(1)) -- Force ClickHouse to change data ALTER TABLE ontime UPDATE TailNum = TailNum, Year = Year WHERE 1 59
  • 60. © 2022 Altinity, Inc. Effect of codec and compression changes 60
  • 61. © 2022 Altinity, Inc. © 2022 Altinity, Inc. Getting started on applications 61
  • 62. © 2022 Altinity, Inc. Where is the software? (All open source!) 62 Event streaming ● Apache Kafka ● Apache Pulsar ● Vectorized Redpanda ELT ● Apache Airflow ● Rudderstack Rendering/Display ● Apache Superset ● Cube.js ● Grafana Client Libraries ● C++ - ClickHouse CPP ● Golang - ClickHouse Go ● Java - ClickHouse JDBC ● Javascript/Node.js - Apla ● ODBC - ODBC Driver for ClickHouse ● Python - ClickHouse Driver, ClickHouse SQLAlchemy More client library links HERE Kubernetes ● Altinity Operator for ClickHouse
  • 63. © 2022 Altinity, Inc. Where is the documentation? ClickHouse official docs – https://clickhouse.com/docs/ Altinity Blog – https://altinity.com/blog/ Altinity Youtube Channel – https://www.youtube.com/channel/UCE3Y2lDKl_ZfjaCrh62onYA Altinity Knowledge Base – https://kb.altinity.com/ Meetups, other blogs, and external resources. Use your powers of Search! 63
  • 64. © 2022 Altinity, Inc. Where can I get help? Telegram - ClickHouse Channel Slack ● ClickHouse Public Workspace - clickhousedb.slack.com ● Altinity Public Workspace - altinitydbworkspace.slack.com Education - Altinity ClickHouse Training Support - Altinity offers support for ClickHouse in all environments 64
  • 65. © 2022 Altinity, Inc. Thank you and good luck! Website: https://altinity.com Email: info@altinity.com Slack: altinitydbworkspace.slack.com 65 Altinity.Cloud Altinity Support Altinity Stable Builds We’re hiring!