PostgreSQL performance archaeology

T
Tomas VondraSoftware developer, Consultant at 2ndQuadrant
Performance Archaeology 
Tomáš Vondra, GoodData 
tomas.vondra@gooddata.com / tomas@pgaddict.com 
@fuzzycz, http://blog.pgaddict.com 
Photo by Jason Quinlan, Creative Commons CC-BY-NC-SA 
https://www.flickr.com/photos/catalhoyuk/9400568431
How did the PostgreSQL performance 
evolve over the time? 
7.4 released 2003, i.e. ~10 years
(surprisingly) tricky question 
● usually “partial” tests during development 
– compare two versions / commits 
– focused on a particular part of the code / feature 
● more complex benchmarks compare two versions 
– difficult to “combine” (different hardware, ...) 
● application performance (ultimate benchmark) 
– apps are subject to (regulard) hardware upgrades 
– amounts of data grow, applications evolve (new features)
(somehow) unfair question 
● we do develop within context of the current hardware 
– How much RAM did you use 10 years ago? 
– Who of you had SSD/NVRAM drives 10 years ago? 
– How common were machines with 8 cores? 
● some differences are consequence of these changes 
● a lot of stuff was improved outside PostgreSQL (ext3 -> ext4) 
Better performance on current 
hardware is always nice ;-)
Let's do some benchmarks!
short version: 
We're much faster and more scalable.
If you're scared of numbers or charts, 
you should probably leave now.
http://blog.pgaddict.com 
http://planet.postgresql.org 
http://slidesha.re/1CUv3xO
Benchmarks (overview) 
● pgbench (TPC-B) 
– “transactional” benchmark 
– operations work with small row sets (access through PKs, ...) 
● TPC-DS (replaces TPC-H) 
– “warehouse” benchmark 
– queries chewing large amounts of data (aggregations, joins, 
ROLLUP/CUBE, ...) 
● fulltext benchmark (tsearch2) 
– primarily about improvements of GIN/GiST indexes 
– now just fulltext, there are many other uses for GIN/GiST (geo, ...)
Hardware used 
HP DL380 G5 (2007-2009) 
● 2x Xeon E5450 (each 4 cores @ 3GHz, 12MB cache) 
● 16GB RAM (FB-DIMM DDR2 667 MHz), FSB 1333 MHz 
● S3700 100GB (SSD) 
● 6x10k RAID10 (SAS) @ P400 with 512MB write cache 
● Scientific Linux 6.5 / kernel 2.6.32, ext4
pgbench 
TPC-B “transactional” benchmark
pgbench 
● three dataset sizes 
– small (150 MB) 
– medium (~50% RAM) 
– large (~200% RAM) 
● two modes 
– read-only and read-write 
● client counts (1, 2, 4, ..., 32) 
● 3 runs / 30 minute each (per combination)
pgbench 
● three dataset sizes 
– small (150 MB) <– locking issues, etc. 
– medium (~50% RAM) <– CPU bound 
– large (~200% RAM) <– I/O bound 
● two modes 
– read-only and read-write 
● client counts (1, 2, 4, ..., 32) 
● 3 runs / 30 minute each (per combination)
BEGIN; 
UPDATE accounts SET abalance = abalance + :delta 
WHERE aid = :aid; 
SELECT abalance FROM accounts WHERE aid = :aid; 
UPDATE tellers SET tbalance = tbalance + :delta 
WHERE tid = :tid; 
UPDATE branches SET bbalance = bbalance + :delta 
WHERE bid = :bid; 
INSERT INTO history (tid, bid, aid, delta, mtime) 
VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); 
END;
0 5 10 15 20 25 30 35 
12000 
10000 
8000 
6000 
4000 
2000 
0 
pgbench / large read-only (on SSD) 
HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD 
number of clients 
7.4 8.0 8.1 head 
transactions per second
0 5 10 15 20 25 30 35 
80000 
70000 
60000 
50000 
40000 
30000 
20000 
10000 
0 
pgbench / medium read-only (SSD) 
HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD 
number of clients 
7.4 8.0 8.1 8.2 8.3 9.0 9.2 
transactions per second
0 5 10 15 20 25 30 35 
3000 
2500 
2000 
1500 
1000 
500 
0 
pgbench / large read-write (SSD) 
HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD 
number of clients 
7.4 8.1 8.3 9.1 9.2 
transactions per second
0 5 10 15 20 25 30 35 
6000 
5000 
4000 
3000 
2000 
1000 
0 
pgbench / small read-write (SSD) 
HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD 
number of clients 
7.4 8.0 8.1 8.2 8.3 8.4 9.0 9.2 
transactions per second
What about rotational drives? 
6 x 10k SAS drives (RAID 10) 
P400 with 512MB write cache
0 5 10 15 20 25 30 
800 
700 
600 
500 
400 
300 
200 
100 
0 
pgbench / large read-write (SAS) 
HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), 6x 10k SAS RAID10 
number of clients 
7.4 (sas) 8.4 (sas) 9.4 (sas) 
transaction per second
What about a different machine?
Alternative hardware 
Workstation i5 (2011-2013) 
● 1x i5-2500k (4 cores @ 3.3 GHz, 6MB cache) 
● 8GB RAM (DIMM DDR3 1333 MHz) 
● S3700 100GB (SSD) 
● Gentoo, kernel 3.12, ext4
0 5 10 15 20 25 30 35 
40000 
35000 
30000 
25000 
20000 
15000 
10000 
5000 
0 
pgbench / large read-only (Xeon vs. i5) 
2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD 
i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD 
number of clients 
7.4 (Xeon) 9.0 (Xeon) 7.4 (i5) 9.0 (i5) 
transactions per second
0 5 10 15 20 25 30 35 
100000 
80000 
60000 
40000 
20000 
0 
pgbench / small read-only (Xeon vs. i5) 
2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD 
i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD 
number of clients 
7.4 (Xeon) 9.0 (Xeon) 9.4 (Xeon) 
7.4 (i5) 9.0 (i5) 9.4 (i5) 
transactions per second
0 5 10 15 20 25 30 35 
8000 
7000 
6000 
5000 
4000 
3000 
2000 
1000 
0 
pgbench / small read-write (Xeon vs. i5) 
2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD 
i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD 
number of clients 
7.4 (Xeon) 9.4 (Xeon) 7.4 (i5) 9.4b1 (i5) 
transactions per second
Legends say older version 
work better with lower memory limits 
(shared_buffers etc.)
0 5 10 15 20 25 30 35 
40000 
35000 
30000 
25000 
20000 
15000 
10000 
5000 
0 
pgbench / large read-only (i5-2500) 
different sizes of shared_buffers (128MB vs. 2GB) 
number of clients 
7.4 7.4 (small) 8.0 
8.0 (small) 9.4b1 
transactions per second
pgbench / summary 
● much better 
● improved locking 
– much better scalability to a lot of cores (>= 64) 
● a lot of different optimizations 
– significant improvements even for small client counts 
● lessons learned 
– CPU frequency is very poor measure 
– similarly for number of cores etc.
TPC-DS 
“Decision Support” benchmark 
(aka “Data Warehouse” benchmark)
TPC-DS 
● analytics workloads / warehousing 
– queries processing large data sets (GROUP BY, JOIN) 
– non-uniform distribution (more realistic than TPC-H) 
● 99 query templates defined (TPC-H just 22) 
– some broken (failing generator) 
– some unsupported (e.g. ROLLUP/CUBE) 
– 41 queries >= 7.4 
– 61 queries >= 8.4 (CTE, Window functions) 
– no query rewrites
TPC-DS 
● 1GB and 16GB datasets (raw data) 
– 1GB insufficient for publication, 16GB nonstandard (according to TPC) 
● interesting anyways ... 
– a lot of databases fit into 16GB 
– shows trends (applicable to large DBs) 
● schema 
– pretty much default (standard compliance FTW!) 
– same for all versions (indexes K/join keys, a few more indexes) 
– definitely room for improvements (per version, ...)
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 
7000 
6000 
5000 
4000 
3000 
2000 
1000 
0 
TPC DS / database size per 1GB raw data 
data indexes 
size [MB]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 
1400 
1200 
1000 
800 
600 
400 
200 
0 
TPC DS / load duration (1GB) 
copy indexes vacuum full vacuum freeze analyze 
duration [s]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 
1200 
1000 
800 
600 
400 
200 
0 
TPC DS / load duration (1GB) 
copy indexes vacuum freeze analyze 
duration [s]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 
9000 
8000 
7000 
6000 
5000 
4000 
3000 
2000 
1000 
0 
TPC DS / load duration (16 GB) 
LOAD INDEXES VACUUM FREEZE ANALYZE duration [seconds]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 
350 
300 
250 
200 
150 
100 
50 
0 
TPC DS / duration (1GB) 
average duration of 41 queries 
seconds
8.0* 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 
6000 
5000 
4000 
3000 
2000 
1000 
0 
TPC DS / duration (16 GB) 
average duration of 41 queries 
version 
duration [seconds]
TPC-DS / summary 
● data load much faster 
– most of the time spent on indexes (parallelize, RAM) 
– ignoring VACUUM FULL (different implementation 9.0) 
– slightly less space occupied 
● much faster queries 
– in total the speedup is ~6x 
– wider index usage, index only scans
Fulltext Benchmark 
testing GIN and GiST indexes 
through fulltext search
Fulltext benchmark 
● searching through pgsql mailing list archives 
– ~1M messages, ~5GB of data 
● ~33k real-world queries (from postgresql.org) 
– syntetic queries lead to about the same results 
SELECT id FROM messages 
WHERE body @@ ('high & performance')::tsquery 
ORDER BY ts_rank(body, ('high & performance')::tsquery) 
DESC LIMIT 100;
2000 
1800 
1600 
1400 
1200 
1000 
800 
600 
400 
200 
0 
Fulltext benchmark / load 
COPY / with indexes and PL/pgSQL triggers 
COPY VACUUM FREEZE ANALYZE 
duration [sec]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 
6000 
5000 
4000 
3000 
2000 
1000 
0 
Fulltext benchmark / GiST 
33k queries from postgresql.org [TOP 100] 
total runtime [sec]
8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 
800 
700 
600 
500 
400 
300 
200 
100 
0 
Fulltext benchmark / GIN 
33k queries from postgresql.org [TOP 100] 
total runtime [sec]
8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 
6000 
5000 
4000 
3000 
2000 
1000 
0 
Fulltext benchmark - GiST vs. GIN 
33k queries from postgresql.org [TOP 100] 
GiST GIN 
total duration [sec]
9.4 durations, divided by 9.3 durations (e.g. 0.1 means 10x speedup) 
1.8 
1.6 
1.4 
1.2 
1 
0.8 
0.6 
0.4 
0.2 
0 
Fulltext benchmark / 9.3 vs. 9.4 (GIN fastscan) 
0.1 1 10 100 1000 
duration on 9.3 [miliseconds, log scale] 
9.4 duration (relative to 9.3)
Fulltext / summary 
● GIN fastscan 
– queries combining “frequent & rare” 
– 9.4 scans “frequent” posting lists first 
– exponential speedup for such queries 
– ... which is quite nice ;-) 
● only ~5% queries slowed down 
– mostly queries below 1ms (measurement error)
http://blog.pgaddict.com 
http://planet.postgresql.org 
http://slidesha.re/1CUv3xO
1 of 47

Recommended

PostgreSQL on EXT4, XFS, BTRFS and ZFS by
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSTomas Vondra
6.5K views46 slides
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016 by
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016
PostgreSQL na EXT4, XFS, BTRFS a ZFS / FOSDEM PgDay 2016Tomas Vondra
8.8K views48 slides
PostgreSQL on EXT4, XFS, BTRFS and ZFS by
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSTomas Vondra
47.9K views53 slides
PostgreSQL performance improvements in 9.5 and 9.6 by
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6Tomas Vondra
14.2K views40 slides
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn... by
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...
Linux Kernel Extension for Databases / Александр Крижановский (Tempesta Techn...Ontico
1.3K views54 slides
How mysql handles ORDER BY, GROUP BY, and DISTINCT by
How mysql handles ORDER BY, GROUP BY, and DISTINCTHow mysql handles ORDER BY, GROUP BY, and DISTINCT
How mysql handles ORDER BY, GROUP BY, and DISTINCTSergey Petrunya
4.8K views23 slides

More Related Content

What's hot

MySQL Tokudb engine benchmark by
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmarkLouis liu
884 views16 slides
In-core compression: how to shrink your database size in several times by
In-core compression: how to shrink your database size in several timesIn-core compression: how to shrink your database size in several times
In-core compression: how to shrink your database size in several timesAleksander Alekseev
1.5K views39 slides
Nvmfs benchmark by
Nvmfs benchmarkNvmfs benchmark
Nvmfs benchmarkLouis liu
816 views13 slides
Bluestore by
BluestoreBluestore
BluestorePatrick McGarry
1.3K views51 slides
Postgres-BDR with Google Cloud Platform by
Postgres-BDR with Google Cloud PlatformPostgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud PlatformSungJae Yun
2.2K views50 slides
PostgreSQL by
PostgreSQLPostgreSQL
PostgreSQLReuven Lerner
8K views74 slides

What's hot(20)

MySQL Tokudb engine benchmark by Louis liu
MySQL Tokudb engine benchmarkMySQL Tokudb engine benchmark
MySQL Tokudb engine benchmark
Louis liu884 views
In-core compression: how to shrink your database size in several times by Aleksander Alekseev
In-core compression: how to shrink your database size in several timesIn-core compression: how to shrink your database size in several times
In-core compression: how to shrink your database size in several times
Aleksander Alekseev1.5K views
Nvmfs benchmark by Louis liu
Nvmfs benchmarkNvmfs benchmark
Nvmfs benchmark
Louis liu816 views
Postgres-BDR with Google Cloud Platform by SungJae Yun
Postgres-BDR with Google Cloud PlatformPostgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud Platform
SungJae Yun2.2K views
Performance improvements in PostgreSQL 9.5 and beyond by Tomas Vondra
Performance improvements in PostgreSQL 9.5 and beyondPerformance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyond
Tomas Vondra10.3K views
Comparison of-foss-distributed-storage by Marian Marinov
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
Marian Marinov233 views
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오 by PgDay.Seoul
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
PgDay.Seoul1.4K views
XtraDB 5.7: key performance algorithms by Laurynas Biveinis
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
Laurynas Biveinis1.1K views
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013 by odnoklassniki.ru
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013
Being closer to Cassandra by Oleg Anastasyev. Talk at Cassandra Summit EU 2013
odnoklassniki.ru2.3K views
My sql fabric ha and sharding solutions by Louis liu
My sql fabric ha and sharding solutionsMy sql fabric ha and sharding solutions
My sql fabric ha and sharding solutions
Louis liu1.4K views
100500 способов кэширования в Oracle Database или как достичь максимальной ск... by Ontico
100500 способов кэширования в Oracle Database или как достичь максимальной ск...100500 способов кэширования в Oracle Database или как достичь максимальной ск...
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
Ontico286 views
MySQL async message subscription platform by Louis liu
MySQL async message subscription platformMySQL async message subscription platform
MySQL async message subscription platform
Louis liu1.3K views
Новые возможности полнотекстового поиска в PostgreSQL / Олег Бартунов (Postgr... by Ontico
Новые возможности полнотекстового поиска в PostgreSQL / Олег Бартунов (Postgr...Новые возможности полнотекстового поиска в PostgreSQL / Олег Бартунов (Postgr...
Новые возможности полнотекстового поиска в PostgreSQL / Олег Бартунов (Postgr...
Ontico1.4K views
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ... by Ontico
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...
pg / shardman: шардинг в PostgreSQL на основе postgres / fdw, pg / pathman и ...
Ontico663 views
Mastering PostgreSQL Administration by EDB
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
EDB7.2K views
Exploiting Your File System to Build Robust & Efficient Workflows by jasonajohnson
Exploiting Your File System to Build Robust & Efficient WorkflowsExploiting Your File System to Build Robust & Efficient Workflows
Exploiting Your File System to Build Robust & Efficient Workflows
jasonajohnson2.2K views
MyAWR another mysql awr by Louis liu
MyAWR another mysql awrMyAWR another mysql awr
MyAWR another mysql awr
Louis liu3.4K views

Viewers also liked

GPGPU Accelerates PostgreSQL (English) by
GPGPU Accelerates PostgreSQL (English)GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)Kohei KaiGai
102.2K views56 slides
淺入淺出 MySQL & PostgreSQL by
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQLYi-Feng Tzeng
18K views147 slides
12-Step Program for Scaling Web Applications on PostgreSQL by
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
69.1K views101 slides
PostgreSQL 9.6 Performance-Scalability Improvements by
PostgreSQL 9.6 Performance-Scalability ImprovementsPostgreSQL 9.6 Performance-Scalability Improvements
PostgreSQL 9.6 Performance-Scalability ImprovementsPGConf APAC
2.6K views26 slides
Lessons PostgreSQL learned from commercial databases, and didn’t by
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tPGConf APAC
1.7K views21 slides
What’s New in Amazon Aurora for MySQL and PostgreSQL by
What’s New in Amazon Aurora for MySQL and PostgreSQLWhat’s New in Amazon Aurora for MySQL and PostgreSQL
What’s New in Amazon Aurora for MySQL and PostgreSQLAmazon Web Services
7.2K views65 slides

Viewers also liked(12)

GPGPU Accelerates PostgreSQL (English) by Kohei KaiGai
GPGPU Accelerates PostgreSQL (English)GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)
Kohei KaiGai102.2K views
淺入淺出 MySQL & PostgreSQL by Yi-Feng Tzeng
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL
Yi-Feng Tzeng18K views
12-Step Program for Scaling Web Applications on PostgreSQL by Konstantin Gredeskoul
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
Konstantin Gredeskoul69.1K views
PostgreSQL 9.6 Performance-Scalability Improvements by PGConf APAC
PostgreSQL 9.6 Performance-Scalability ImprovementsPostgreSQL 9.6 Performance-Scalability Improvements
PostgreSQL 9.6 Performance-Scalability Improvements
PGConf APAC2.6K views
Lessons PostgreSQL learned from commercial databases, and didn’t by PGConf APAC
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
PGConf APAC1.7K views
What’s New in Amazon Aurora for MySQL and PostgreSQL by Amazon Web Services
What’s New in Amazon Aurora for MySQL and PostgreSQLWhat’s New in Amazon Aurora for MySQL and PostgreSQL
What’s New in Amazon Aurora for MySQL and PostgreSQL
Amazon Web Services7.2K views
PostgreSQL Security. How Do We Think? by Ohyama Masanori
PostgreSQL Security. How Do We Think?PostgreSQL Security. How Do We Think?
PostgreSQL Security. How Do We Think?
Ohyama Masanori4.2K views
(JP) GPGPUがPostgreSQLを加速する by Kohei KaiGai
(JP) GPGPUがPostgreSQLを加速する(JP) GPGPUがPostgreSQLを加速する
(JP) GPGPUがPostgreSQLを加速する
Kohei KaiGai23.9K views
第51回NDS PostgreSQLのデータ型 #nds51 by civicpg
第51回NDS PostgreSQLのデータ型 #nds51第51回NDS PostgreSQLのデータ型 #nds51
第51回NDS PostgreSQLのデータ型 #nds51
civicpg4.4K views
Open Source SQL databases enter millions queries per second era by Alexander Korotkov
Open Source SQL databases enter millions queries per second eraOpen Source SQL databases enter millions queries per second era
Open Source SQL databases enter millions queries per second era
Alexander Korotkov3.1K views

Similar to PostgreSQL performance archaeology

Speedrunning the Open Street Map osm2pgsql Loader by
Speedrunning the Open Street Map osm2pgsql LoaderSpeedrunning the Open Street Map osm2pgsql Loader
Speedrunning the Open Street Map osm2pgsql LoaderGregSmith458515
1.2K views24 slides
LUG 2014 by
LUG 2014LUG 2014
LUG 2014Hitoshi Sato
839 views20 slides
Accelerating HBase with NVMe and Bucket Cache by
Accelerating HBase with NVMe and Bucket CacheAccelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket CacheNicolas Poggi
1.2K views33 slides
Accelerating hbase with nvme and bucket cache by
Accelerating hbase with nvme and bucket cacheAccelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cacheDavid Grier
571 views34 slides
IO Dubi Lebel by
IO Dubi LebelIO Dubi Lebel
IO Dubi Lebelsqlserver.co.il
1.2K views104 slides
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 fin by
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 finCерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 fin
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 finDEPO Computers
2.2K views68 slides

Similar to PostgreSQL performance archaeology(20)

Speedrunning the Open Street Map osm2pgsql Loader by GregSmith458515
Speedrunning the Open Street Map osm2pgsql LoaderSpeedrunning the Open Street Map osm2pgsql Loader
Speedrunning the Open Street Map osm2pgsql Loader
GregSmith4585151.2K views
Accelerating HBase with NVMe and Bucket Cache by Nicolas Poggi
Accelerating HBase with NVMe and Bucket CacheAccelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket Cache
Nicolas Poggi1.2K views
Accelerating hbase with nvme and bucket cache by David Grier
Accelerating hbase with nvme and bucket cacheAccelerating hbase with nvme and bucket cache
Accelerating hbase with nvme and bucket cache
David Grier571 views
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 fin by DEPO Computers
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 finCерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 fin
Cерверы Depo storm 3400 на базе новейших процессоров intel xeon e5 2600v3 fin
DEPO Computers2.2K views
3.INTEL.Optane_on_ceph_v2.pdf by hellobank1
3.INTEL.Optane_on_ceph_v2.pdf3.INTEL.Optane_on_ceph_v2.pdf
3.INTEL.Optane_on_ceph_v2.pdf
hellobank14 views
Ceph Day Beijing - Optimizing Ceph Performance by Leveraging Intel Optane and... by Danielle Womboldt
Ceph Day Beijing - Optimizing Ceph Performance by Leveraging Intel Optane and...Ceph Day Beijing - Optimizing Ceph Performance by Leveraging Intel Optane and...
Ceph Day Beijing - Optimizing Ceph Performance by Leveraging Intel Optane and...
Danielle Womboldt1.6K views
Ceph Day Beijing - Optimizing Ceph performance by leveraging Intel Optane and... by Ceph Community
Ceph Day Beijing - Optimizing Ceph performance by leveraging Intel Optane and...Ceph Day Beijing - Optimizing Ceph performance by leveraging Intel Optane and...
Ceph Day Beijing - Optimizing Ceph performance by leveraging Intel Optane and...
Ceph Community 109 views
Adventures in RDS Load Testing by Mike Harnish
Adventures in RDS Load TestingAdventures in RDS Load Testing
Adventures in RDS Load Testing
Mike Harnish3.6K views
Red Hat Storage Day Atlanta - Designing Ceph Clusters Using Intel-Based Hardw... by Red_Hat_Storage
Red Hat Storage Day Atlanta - Designing Ceph Clusters Using Intel-Based Hardw...Red Hat Storage Day Atlanta - Designing Ceph Clusters Using Intel-Based Hardw...
Red Hat Storage Day Atlanta - Designing Ceph Clusters Using Intel-Based Hardw...
Red_Hat_Storage414 views
High performance json- postgre sql vs. mongodb by Wei Shan Ang
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
Wei Shan Ang640 views
HeroLympics Eng V03 Henk Vd Valk by hvdvalk
HeroLympics  Eng V03 Henk Vd ValkHeroLympics  Eng V03 Henk Vd Valk
HeroLympics Eng V03 Henk Vd Valk
hvdvalk495 views
計算力学シミュレーションに GPU は役立つのか? by Shinnosuke Furuya
計算力学シミュレーションに GPU は役立つのか?計算力学シミュレーションに GPU は役立つのか?
計算力学シミュレーションに GPU は役立つのか?
Shinnosuke Furuya716 views
Challenges and Trends of SSD Design by Henry Chao
Challenges and Trends of SSD DesignChallenges and Trends of SSD Design
Challenges and Trends of SSD Design
Henry Chao1.5K views
Ceph Day Tokyo - Delivering cost effective, high performance Ceph cluster by Ceph Community
Ceph Day Tokyo - Delivering cost effective, high performance Ceph clusterCeph Day Tokyo - Delivering cost effective, high performance Ceph cluster
Ceph Day Tokyo - Delivering cost effective, high performance Ceph cluster
Ceph Community 233 views
Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ... by Databricks
Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ...Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ...
Running Apache Spark on a High-Performance Cluster Using RDMA and NVMe Flash ...
Databricks2.8K views
Ceph Day KL - Delivering cost-effective, high performance Ceph cluster by Ceph Community
Ceph Day KL - Delivering cost-effective, high performance Ceph clusterCeph Day KL - Delivering cost-effective, high performance Ceph cluster
Ceph Day KL - Delivering cost-effective, high performance Ceph cluster
Ceph Community 126 views
SQL Server It Just Runs Faster by Bob Ward
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
Bob Ward764 views

More from Tomas Vondra

CREATE STATISTICS - What is it for? (PostgresLondon) by
CREATE STATISTICS - What is it for? (PostgresLondon)CREATE STATISTICS - What is it for? (PostgresLondon)
CREATE STATISTICS - What is it for? (PostgresLondon)Tomas Vondra
1.9K views36 slides
Data corruption by
Data corruptionData corruption
Data corruptionTomas Vondra
1.8K views34 slides
CREATE STATISTICS - what is it for? by
CREATE STATISTICS - what is it for?CREATE STATISTICS - what is it for?
CREATE STATISTICS - what is it for?Tomas Vondra
481 views35 slides
DB vs. encryption by
DB vs. encryptionDB vs. encryption
DB vs. encryptionTomas Vondra
111 views19 slides
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAlt by
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAltPostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAlt
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAltTomas Vondra
938 views49 slides
Postgresql na EXT3/4, XFS, BTRFS a ZFS by
Postgresql na EXT3/4, XFS, BTRFS a ZFSPostgresql na EXT3/4, XFS, BTRFS a ZFS
Postgresql na EXT3/4, XFS, BTRFS a ZFSTomas Vondra
1.3K views40 slides

More from Tomas Vondra(14)

CREATE STATISTICS - What is it for? (PostgresLondon) by Tomas Vondra
CREATE STATISTICS - What is it for? (PostgresLondon)CREATE STATISTICS - What is it for? (PostgresLondon)
CREATE STATISTICS - What is it for? (PostgresLondon)
Tomas Vondra1.9K views
CREATE STATISTICS - what is it for? by Tomas Vondra
CREATE STATISTICS - what is it for?CREATE STATISTICS - what is it for?
CREATE STATISTICS - what is it for?
Tomas Vondra481 views
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAlt by Tomas Vondra
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAltPostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAlt
PostgreSQL na EXT4, XFS, BTRFS a ZFS / OpenAlt
Tomas Vondra938 views
Postgresql na EXT3/4, XFS, BTRFS a ZFS by Tomas Vondra
Postgresql na EXT3/4, XFS, BTRFS a ZFSPostgresql na EXT3/4, XFS, BTRFS a ZFS
Postgresql na EXT3/4, XFS, BTRFS a ZFS
Tomas Vondra1.3K views
Novinky v PostgreSQL 9.4 a JSONB by Tomas Vondra
Novinky v PostgreSQL 9.4 a JSONBNovinky v PostgreSQL 9.4 a JSONB
Novinky v PostgreSQL 9.4 a JSONB
Tomas Vondra6.5K views
Výkonnostní archeologie by Tomas Vondra
Výkonnostní archeologieVýkonnostní archeologie
Výkonnostní archeologie
Tomas Vondra849 views
Český fulltext a sdílené slovníky by Tomas Vondra
Český fulltext a sdílené slovníkyČeský fulltext a sdílené slovníky
Český fulltext a sdílené slovníky
Tomas Vondra955 views
SSD vs HDD / WAL, indexes and fsync by Tomas Vondra
SSD vs HDD / WAL, indexes and fsyncSSD vs HDD / WAL, indexes and fsync
SSD vs HDD / WAL, indexes and fsync
Tomas Vondra1.2K views
Checkpoint (CSPUG 22.11.2011) by Tomas Vondra
Checkpoint (CSPUG 22.11.2011)Checkpoint (CSPUG 22.11.2011)
Checkpoint (CSPUG 22.11.2011)
Tomas Vondra630 views
Čtení explain planu (CSPUG 21.6.2011) by Tomas Vondra
Čtení explain planu (CSPUG 21.6.2011)Čtení explain planu (CSPUG 21.6.2011)
Čtení explain planu (CSPUG 21.6.2011)
Tomas Vondra1.7K views
Replikace (CSPUG 19.4.2011) by Tomas Vondra
Replikace (CSPUG 19.4.2011)Replikace (CSPUG 19.4.2011)
Replikace (CSPUG 19.4.2011)
Tomas Vondra740 views
PostgreSQL / Performance monitoring by Tomas Vondra
PostgreSQL / Performance monitoringPostgreSQL / Performance monitoring
PostgreSQL / Performance monitoring
Tomas Vondra6.1K views

Recently uploaded

Keep by
KeepKeep
KeepGeniusee
77 views10 slides
Myths and Facts About Hospice Care: Busting Common Misconceptions by
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common MisconceptionsCare Coordinations
6 views1 slide
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Donato Onofri
860 views34 slides
ShortStory_qlora.pptx by
ShortStory_qlora.pptxShortStory_qlora.pptx
ShortStory_qlora.pptxpranathikrishna22
5 views10 slides
Navigating container technology for enhanced security by Niklas Saari by
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
14 views34 slides
Top-5-production-devconMunich-2023.pptx by
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
7 views40 slides

Recently uploaded(20)

Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri860 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app7 views
Bootstrapping vs Venture Capital.pptx by Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic12 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 views
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports by Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski10 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller41 views
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi212 views
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok6 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan5 views
Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...

PostgreSQL performance archaeology

  • 1. Performance Archaeology Tomáš Vondra, GoodData tomas.vondra@gooddata.com / tomas@pgaddict.com @fuzzycz, http://blog.pgaddict.com Photo by Jason Quinlan, Creative Commons CC-BY-NC-SA https://www.flickr.com/photos/catalhoyuk/9400568431
  • 2. How did the PostgreSQL performance evolve over the time? 7.4 released 2003, i.e. ~10 years
  • 3. (surprisingly) tricky question ● usually “partial” tests during development – compare two versions / commits – focused on a particular part of the code / feature ● more complex benchmarks compare two versions – difficult to “combine” (different hardware, ...) ● application performance (ultimate benchmark) – apps are subject to (regulard) hardware upgrades – amounts of data grow, applications evolve (new features)
  • 4. (somehow) unfair question ● we do develop within context of the current hardware – How much RAM did you use 10 years ago? – Who of you had SSD/NVRAM drives 10 years ago? – How common were machines with 8 cores? ● some differences are consequence of these changes ● a lot of stuff was improved outside PostgreSQL (ext3 -> ext4) Better performance on current hardware is always nice ;-)
  • 5. Let's do some benchmarks!
  • 6. short version: We're much faster and more scalable.
  • 7. If you're scared of numbers or charts, you should probably leave now.
  • 9. Benchmarks (overview) ● pgbench (TPC-B) – “transactional” benchmark – operations work with small row sets (access through PKs, ...) ● TPC-DS (replaces TPC-H) – “warehouse” benchmark – queries chewing large amounts of data (aggregations, joins, ROLLUP/CUBE, ...) ● fulltext benchmark (tsearch2) – primarily about improvements of GIN/GiST indexes – now just fulltext, there are many other uses for GIN/GiST (geo, ...)
  • 10. Hardware used HP DL380 G5 (2007-2009) ● 2x Xeon E5450 (each 4 cores @ 3GHz, 12MB cache) ● 16GB RAM (FB-DIMM DDR2 667 MHz), FSB 1333 MHz ● S3700 100GB (SSD) ● 6x10k RAID10 (SAS) @ P400 with 512MB write cache ● Scientific Linux 6.5 / kernel 2.6.32, ext4
  • 12. pgbench ● three dataset sizes – small (150 MB) – medium (~50% RAM) – large (~200% RAM) ● two modes – read-only and read-write ● client counts (1, 2, 4, ..., 32) ● 3 runs / 30 minute each (per combination)
  • 13. pgbench ● three dataset sizes – small (150 MB) <– locking issues, etc. – medium (~50% RAM) <– CPU bound – large (~200% RAM) <– I/O bound ● two modes – read-only and read-write ● client counts (1, 2, 4, ..., 32) ● 3 runs / 30 minute each (per combination)
  • 14. BEGIN; UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid; SELECT abalance FROM accounts WHERE aid = :aid; UPDATE tellers SET tbalance = tbalance + :delta WHERE tid = :tid; UPDATE branches SET bbalance = bbalance + :delta WHERE bid = :bid; INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); END;
  • 15. 0 5 10 15 20 25 30 35 12000 10000 8000 6000 4000 2000 0 pgbench / large read-only (on SSD) HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD number of clients 7.4 8.0 8.1 head transactions per second
  • 16. 0 5 10 15 20 25 30 35 80000 70000 60000 50000 40000 30000 20000 10000 0 pgbench / medium read-only (SSD) HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD number of clients 7.4 8.0 8.1 8.2 8.3 9.0 9.2 transactions per second
  • 17. 0 5 10 15 20 25 30 35 3000 2500 2000 1500 1000 500 0 pgbench / large read-write (SSD) HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD number of clients 7.4 8.1 8.3 9.1 9.2 transactions per second
  • 18. 0 5 10 15 20 25 30 35 6000 5000 4000 3000 2000 1000 0 pgbench / small read-write (SSD) HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), Intel S3700 100GB SSD number of clients 7.4 8.0 8.1 8.2 8.3 8.4 9.0 9.2 transactions per second
  • 19. What about rotational drives? 6 x 10k SAS drives (RAID 10) P400 with 512MB write cache
  • 20. 0 5 10 15 20 25 30 800 700 600 500 400 300 200 100 0 pgbench / large read-write (SAS) HP DL380 G5 (2x Xeon E5450, 16 GB DDR2 RAM), 6x 10k SAS RAID10 number of clients 7.4 (sas) 8.4 (sas) 9.4 (sas) transaction per second
  • 21. What about a different machine?
  • 22. Alternative hardware Workstation i5 (2011-2013) ● 1x i5-2500k (4 cores @ 3.3 GHz, 6MB cache) ● 8GB RAM (DIMM DDR3 1333 MHz) ● S3700 100GB (SSD) ● Gentoo, kernel 3.12, ext4
  • 23. 0 5 10 15 20 25 30 35 40000 35000 30000 25000 20000 15000 10000 5000 0 pgbench / large read-only (Xeon vs. i5) 2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD number of clients 7.4 (Xeon) 9.0 (Xeon) 7.4 (i5) 9.0 (i5) transactions per second
  • 24. 0 5 10 15 20 25 30 35 100000 80000 60000 40000 20000 0 pgbench / small read-only (Xeon vs. i5) 2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD number of clients 7.4 (Xeon) 9.0 (Xeon) 9.4 (Xeon) 7.4 (i5) 9.0 (i5) 9.4 (i5) transactions per second
  • 25. 0 5 10 15 20 25 30 35 8000 7000 6000 5000 4000 3000 2000 1000 0 pgbench / small read-write (Xeon vs. i5) 2x Xeon E5450 (3GHz), 16 GB DDR2 RAM, Intel S3700 100GB SSD i5-2500k (3.3 GHz), 8GB DDR3 RAM, Intel S3700 100GB SSD number of clients 7.4 (Xeon) 9.4 (Xeon) 7.4 (i5) 9.4b1 (i5) transactions per second
  • 26. Legends say older version work better with lower memory limits (shared_buffers etc.)
  • 27. 0 5 10 15 20 25 30 35 40000 35000 30000 25000 20000 15000 10000 5000 0 pgbench / large read-only (i5-2500) different sizes of shared_buffers (128MB vs. 2GB) number of clients 7.4 7.4 (small) 8.0 8.0 (small) 9.4b1 transactions per second
  • 28. pgbench / summary ● much better ● improved locking – much better scalability to a lot of cores (>= 64) ● a lot of different optimizations – significant improvements even for small client counts ● lessons learned – CPU frequency is very poor measure – similarly for number of cores etc.
  • 29. TPC-DS “Decision Support” benchmark (aka “Data Warehouse” benchmark)
  • 30. TPC-DS ● analytics workloads / warehousing – queries processing large data sets (GROUP BY, JOIN) – non-uniform distribution (more realistic than TPC-H) ● 99 query templates defined (TPC-H just 22) – some broken (failing generator) – some unsupported (e.g. ROLLUP/CUBE) – 41 queries >= 7.4 – 61 queries >= 8.4 (CTE, Window functions) – no query rewrites
  • 31. TPC-DS ● 1GB and 16GB datasets (raw data) – 1GB insufficient for publication, 16GB nonstandard (according to TPC) ● interesting anyways ... – a lot of databases fit into 16GB – shows trends (applicable to large DBs) ● schema – pretty much default (standard compliance FTW!) – same for all versions (indexes K/join keys, a few more indexes) – definitely room for improvements (per version, ...)
  • 32. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 7000 6000 5000 4000 3000 2000 1000 0 TPC DS / database size per 1GB raw data data indexes size [MB]
  • 33. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 1400 1200 1000 800 600 400 200 0 TPC DS / load duration (1GB) copy indexes vacuum full vacuum freeze analyze duration [s]
  • 34. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 1200 1000 800 600 400 200 0 TPC DS / load duration (1GB) copy indexes vacuum freeze analyze duration [s]
  • 35. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 9000 8000 7000 6000 5000 4000 3000 2000 1000 0 TPC DS / load duration (16 GB) LOAD INDEXES VACUUM FREEZE ANALYZE duration [seconds]
  • 36. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 head 350 300 250 200 150 100 50 0 TPC DS / duration (1GB) average duration of 41 queries seconds
  • 37. 8.0* 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 6000 5000 4000 3000 2000 1000 0 TPC DS / duration (16 GB) average duration of 41 queries version duration [seconds]
  • 38. TPC-DS / summary ● data load much faster – most of the time spent on indexes (parallelize, RAM) – ignoring VACUUM FULL (different implementation 9.0) – slightly less space occupied ● much faster queries – in total the speedup is ~6x – wider index usage, index only scans
  • 39. Fulltext Benchmark testing GIN and GiST indexes through fulltext search
  • 40. Fulltext benchmark ● searching through pgsql mailing list archives – ~1M messages, ~5GB of data ● ~33k real-world queries (from postgresql.org) – syntetic queries lead to about the same results SELECT id FROM messages WHERE body @@ ('high & performance')::tsquery ORDER BY ts_rank(body, ('high & performance')::tsquery) DESC LIMIT 100;
  • 41. 2000 1800 1600 1400 1200 1000 800 600 400 200 0 Fulltext benchmark / load COPY / with indexes and PL/pgSQL triggers COPY VACUUM FREEZE ANALYZE duration [sec]
  • 42. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 6000 5000 4000 3000 2000 1000 0 Fulltext benchmark / GiST 33k queries from postgresql.org [TOP 100] total runtime [sec]
  • 43. 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 800 700 600 500 400 300 200 100 0 Fulltext benchmark / GIN 33k queries from postgresql.org [TOP 100] total runtime [sec]
  • 44. 8.0 8.1 8.2 8.3 8.4 9.0 9.1 9.2 9.3 9.4 6000 5000 4000 3000 2000 1000 0 Fulltext benchmark - GiST vs. GIN 33k queries from postgresql.org [TOP 100] GiST GIN total duration [sec]
  • 45. 9.4 durations, divided by 9.3 durations (e.g. 0.1 means 10x speedup) 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 Fulltext benchmark / 9.3 vs. 9.4 (GIN fastscan) 0.1 1 10 100 1000 duration on 9.3 [miliseconds, log scale] 9.4 duration (relative to 9.3)
  • 46. Fulltext / summary ● GIN fastscan – queries combining “frequent & rare” – 9.4 scans “frequent” posting lists first – exponential speedup for such queries – ... which is quite nice ;-) ● only ~5% queries slowed down – mostly queries below 1ms (measurement error)