Professional Documents
Culture Documents
Postgresql Benchmark
Postgresql Benchmark
Hans-Jürgen Schönig
www.postgresql-support.de
Hans-Jürgen Schönig
www.postgresql-support.de
Reaching a milestone
Hans-Jürgen Schönig
www.postgresql-support.de
Goal
Hans-Jürgen Schönig
www.postgresql-support.de
Traditional PostgreSQL limitations
I Traditionally:
I We could only use 1 CPU core per query
I Scaling was possible by running more than one query at a time
I Usually hard to do
Hans-Jürgen Schönig
www.postgresql-support.de
PL/Proxy: The traditional way to do it
Hans-Jürgen Schönig
www.postgresql-support.de
On the app level
Hans-Jürgen Schönig
www.postgresql-support.de
The 1 billion row challenge
Hans-Jürgen Schönig
www.postgresql-support.de
Coming up with a data structure
node=# \d t_demo
Table "public.t_demo"
Column | Type | Collation | Nullable |
--------+---------+-----------+----------+
id | serial | | not null |
grp | integer | | |
data | real | | |
Indexes:
"idx_id" btree (id)
Hans-Jürgen Schönig
www.postgresql-support.de
The query
Hans-Jürgen Schönig
www.postgresql-support.de
Single server performance
Hans-Jürgen Schönig
www.postgresql-support.de
Tweaking a simple server
Hans-Jürgen Schönig
www.postgresql-support.de
PostgreSQL parallelism
Hans-Jürgen Schönig
www.postgresql-support.de
Adjusting CPU core usage
Hans-Jürgen Schönig
www.postgresql-support.de
Overruling the planner
Hans-Jürgen Schönig
www.postgresql-support.de
Making full use of cores
Hans-Jürgen Schönig
www.postgresql-support.de
Single node scalability (1)
Hans-Jürgen Schönig
www.postgresql-support.de
{
Single node scalability (2)
Hans-Jürgen Schönig
www.postgresql-support.de
Single node scalability (3)
Hans-Jürgen Schönig
www.postgresql-support.de
Moving on to many nodes
Hans-Jürgen Schönig
www.postgresql-support.de
The basic system architecture (1)
Hans-Jürgen Schönig
www.postgresql-support.de
Testing with two nodes (1)
Hans-Jürgen Schönig
www.postgresql-support.de
Testing with two nodes (2)
Hans-Jürgen Schönig
www.postgresql-support.de
Preconditions to make it work (1)
Hans-Jürgen Schönig
www.postgresql-support.de
Preconditions to make it work (2)
Hans-Jürgen Schönig
www.postgresql-support.de
Preconditions to make it work (3)
Hans-Jürgen Schönig
www.postgresql-support.de
Preconditions to make it work (4)
I Easy tasks:
I Aggregates have to be implemented to handle partial results
coming from shards
I Code is simple and available as extension
I For the test we implemented a handful of aggregates
Hans-Jürgen Schönig
www.postgresql-support.de
Parallel execution on shards is now possible
I Dissect aggregation
I Send partial queries to shards in parallel
I Perform parallel execution on shards
I Add up data on main node
Hans-Jürgen Schönig
www.postgresql-support.de
Final results
Hans-Jürgen Schönig
www.postgresql-support.de
Hardware used
Hans-Jürgen Schönig
www.postgresql-support.de
A look at PostgreSQL 10.0
Hans-Jürgen Schönig
www.postgresql-support.de
More complex plans
Hans-Jürgen Schönig
www.postgresql-support.de
Future ideas: JIT compilation
Hans-Jürgen Schönig
www.postgresql-support.de
Future ideas: “Deeper execution”
Hans-Jürgen Schönig
www.postgresql-support.de
Future things: Column stores
Hans-Jürgen Schönig
www.postgresql-support.de
Finally
I Any questions?
Hans-Jürgen Schönig
www.postgresql-support.de
Contact us
www.postgresql-support.de
Hans-Jürgen Schönig
www.postgresql-support.de