SlideShare a Scribd company logo
/ Robert Treat
9.4 On The Floor
A Talk About Upcoming Features in Postgres 9.4
Thursday, May 22, 14
Hello
@robtreat2
xzilla.net
Thursday, May 22, 14
Hello
Postgres 6.x
Major Contributor
advocacy, tools, web
Thursday, May 22, 14
Hello
Postgres 6.x
Major Contributor
advocacy, tools, web
root beer : crocs : shawarma
Thursday, May 22, 14
Hello
“for companies who need to build scalable and efficient
web services, OmniTI is the leading cross-disciplinary
provider of consulting, development, and operational
resources to help your company grow”
15% of Alexa Top 100
postgres consulting | web development
Thursday, May 22, 14
The Development Cycle
Postgres
Thursday, May 22, 14
The Development Cycle
• June14th,2013-Branch9.4-devel
• June2013-CF1
• September2013-CF2
• November2013-CF3
• January2014-CF4
Thursday, May 22, 14
The Development Cycle
• June14th,2013-Branch9.4-devel
• June2013-CF1
• September2013-CF2
• November2013-CF3
• January2014-CF4
• May15th,2014-Postgres9.4Beta1
Thursday, May 22, 14
The Development Cycle
https://wiki.postgresql.org/wiki/HowToBetaTest
Beta Release == Test Please!
Thursday, May 22, 14
So Whats New?
Performance
Administration
SQL
Backend
Future
Thursday, May 22, 14
Performance
reduce WAL for updates
Reduce the size of WAL records generated for UPDATE
operations
Less WAL volume should mean less I/O & resource usage
Thursday, May 22, 14
Performance
xlog insert scaling
Reduce lock contention for WAL insert operations,
improving scalability of WAL system
Thursday, May 22, 14
Performance
pg_prewarm
Contrib module for loading relation data into memory.
Can choose from OS cache (async or sync) or
shared_buffers.
SELECT pg_prewarm('actor');
Thursday, May 22, 14
Performance
GIN Index improvements
friday @ 4:15 | GIN stronger than ever
compact page format
2x - 10x reduced index size
fast scan improvements
queries w/ some freq. some rare items
Thursday, May 22, 14
Performance
separate planning / exec time in EXPLAIN ANALYZE
pagila=#explain analyze select count(*) from payment where payment_date<='2007-02-01'::date;
QUERY PLAN
--------------------------------------------------------------------------------------------
Aggregate (cost=72.26..72.27 rows=1 width=0) (actual time=11.712..11.712 rows=1 loops=1)
-> Append (cost=0.00..69.36 rows=1159 width=0) (actual time=2.256..11.416 rows=1157
loops=1)
-> Seq Scan on payment (cost=0.00..0.00 rows=1 width=0) (actual time=0.002..0.002
rows=0 loops=1)
Filter: (payment_date <= '2007-02-01'::date)
-> Seq Scan on payment_p2007_01 (cost=0.00..23.46 rows=1157 width=0) (actual
time=2.253..5.728 rows=1157 loops=1)
Filter: (payment_date <= '2007-02-01'::date)
-> Seq Scan on payment_p2007_02 (cost=0.00..45.90 rows=1 width=0) (actual
time=5.380..5.380 rows=0 loops=1)
Filter: (payment_date <= '2007-02-01'::date)
Rows Removed by Filter: 2312
Planning time: 140.555 ms
Execution time: 12.562 ms
(11 rows)
Thursday, May 22, 14
Performance
add “grouping columns” to EXPLAIN output
pagila=# explain select postal_code, count(*)
pagila-# from address group by postal_code;
QUERY PLAN
----------------------------------------------------------------
HashAggregate (cost=17.05..23.02 rows=597 width=5)
Group Key: postal_code
-> Seq Scan on address (cost=0.00..14.03 rows=603 width=5)
Thursday, May 22, 14
Performance
lock wait context
LOG: process 11367 still waiting for ShareLock on transaction 717 after 1000.108 ms
DETAIL: Process holding the lock: 11366. Wait queue: 11367.
CONTEXT: while updating tuple (0,2) in relation "foo"
STATEMENT: UPDATE foo SET value = 3;
Thursday, May 22, 14
So Whats New?
Performance
Administration
SQL
Backend
Future
Thursday, May 22, 14
Administration
ALTER SYSTEM
provide a mechanism to alter system level
configuration from SQL
ALTER SYSTEM SET work_mem='42MB';
SELECT pg_reload_conf();
Thursday, May 22, 14
Administration
pset improvements
pagila=# pset
Border style (border) is 1.
Target width (columns) unset.
Expanded display (expanded) is off.
Field separator (fieldsep) is "|".
Default footer (footer) is on.
Output format (format) is aligned.
Line style (linestyle) is ascii.
Null display (null) is "".
Locale-adjusted numeric output (numericlocale) is off.
Pager (pager) is used for long output.
Record separator (recordsep) is <newline>.
Table attributes (tableattr) unset.
Title (title) unset.
Tuples only (tuples_only) is off.
also now works with tab completion
Thursday, May 22, 14
Administration
set tablespace options at create time
CREATE TABLESPACE rmd
LOCATION '/ramdisk'
WITH (random_page_cost = 0.9);
use to require create + alter
Thursday, May 22, 14
Administration
TABLESPACE SHUFFLING
move objects from one tablespace to another
{tables|indexes|all}
ALTER TABLESPACE pg_default
MOVE INDEXES TO rmd;
Thursday, May 22, 14
Administration
pg_stat_archiver statistics view
$ select * from pg_stat_archiver ;
-[ RECORD 1 ]------+------------------------------
archived_count | 21
last_archived_wal | 00000001000000000000000E
last_archived_time | 2014-04-29 11:37:45.337841+01
failed_count | 12
last_failed_wal | 00000001000000000000000F
last_failed_time | 2014-04-29 11:43:24.732469+01
stats_reset | 2014-04-29 11:37:16.995943+01
Thursday, May 22, 14
Administration
remove kerberos 5 authentication
deprecated since 8.3
use GSSAPI instead
Thursday, May 22, 14
Administration
SSL / TLS improvements
‣ add TLS v1.1/1.2 support
‣ remove SSL v3 support
‣ change default cipher suite to HIGH:!aNULL
‣ HIGH: Contains only secure and well-research algorithms
‣ !aNULL: Needed to disable suites that do not
authenticate server
Thursday, May 22, 14
Administration
config params
autovacuum_work_mem
session_preload_libraries
wal_log_hints
Thursday, May 22, 14
So Whats New?
Performance
Administration
SQL
Backend
Future
Thursday, May 22, 14
SQL
make time
• make_interval(years, months, weeks, days, hours, mins, secs)
• make_timestamp(year, month, day, hour, min, sec)
• make_timestamptz(year, month, day, hour, min, sec, timezone)
pagila=# select make_interval(hours := 2, mins := 1, secs := 1.2);
make_interval
---------------
02:01:01.2
(1 row)
Thursday, May 22, 14
SQL
“moving aggregates”
‣ optimization for aggregates called within moving window of
window function call
‣ initial support for count(), sum(), avg(), stddev(), variance(),
and boolean aggregates
Thursday, May 22, 14
SQL
ordered-set aggregates
‣ new class of aggregates
‣“offset in group”
‣WITHIN GROUP
‣SQL 2008
Thursday, May 22, 14
SQL
ordered-set aggregates
pagila=# select amount, count(*) from payment group by amount order by 1;
amount | count
--------+-------
0.00 | 24
0.99 | 2979
1.98 | 1
1.99 | 640
2.99 | 3542
3.98 | 8
3.99 | 1109
4.99 | 3789
5.98 | 7
5.99 | 1299
6.99 | 1119
7.98 | 5
7.99 | 670
8.97 | 1
8.99 | 485
9.98 | 1
9.99 | 256
10.99 | 104
11.99 | 10
(19 rows)
Thursday, May 22, 14
SQL
ordered-set aggregates
pagila=# SELECT
count(*), min(amount), max(amount),
percentile_cont(0.5) WITHIN GROUP (ORDER BY
amount)
FROM payment;
count | min | max | percentile_disc
-------+------+-------+-----------------
16049 | 0.00 | 11.99 | 3.99
(1 row)
median amount
Thursday, May 22, 14
SQL
ordered-set aggregates
pagila=# SELECT
count(*), min(amount), max(amount),
percentile_cont(array[0.5,0.9])
WITHIN GROUP (ORDER BY amount)
FROM payment;
count | min | max | percentile_disc
-------+------+-------+-----------------
16049 | 0.00 | 11.99 | {3.99,6.99}
(1 row)
Thursday, May 22, 14
SQL
ordered-set aggregates
pagila=# SELECT
count(*),min(amount), max(amount),
mode() within group (order by amount)
FROM payment;
count | min | max | mode
-------+------+-------+------
16049 | 0.00 | 11.99 | 4.99
(1 row)
Thursday, May 22, 14
SQL
ordered-set aggregates
percentile_cont()
percentile_disc()
rank()
dense_rank()
percent_rank()
cume_dist()
mode()
Thursday, May 22, 14
SQL
FILTER aggregates
pagila=# SELECT customer_id, count(*),
count(*) FILTER (WHERE amount > 5)
FROM payment WHERE customer_id = 148 GROUP BY
customer_id;
customer_id | count | count
-------------+-------+-------
148 | 46 | 13
(1 row)
‣ add support for FILTER clause in aggregates
‣ no more case-then-null / case
Thursday, May 22, 14
So Whats New?
Performance
Administration
SQL
Backend
Future
Thursday, May 22, 14
Backend
plpgsql stack traces
CREATE OR REPLACE FUNCTION
public.inner_func() RETURNS integer AS $$
DECLARE
stack text;
BEGIN
GET DIAGNOSTICS stack = PG_CONTEXT;
RAISE NOTICE E'--- Call Stack ---n%',
stack;
RETURN 1;
END;
$$ LANGUAGE plpgsql;
Thursday, May 22, 14
Backend
refresh materialized views concurrently
REFRESH MATERIALIZED VIEW CONCURRENTLY <view>
* requires unique index
Thursday, May 22, 14
Backend
“with check” option for auto-updateable views
‣ given an updateable view
‣ only allow visible rows within the view
‣ LOCAL
‣ checking conditions only on the view itself
‣ CASCADE
‣ recursively check on parents (default)
Thursday, May 22, 14
Backend
jsonb
new storage format for json text data
“binary json”
Thursday, May 22, 14
Backend
jsonb
new storage format for json text data
“binary json”
pros:
✓no need to re-parse data
✓improved indexing support
✓allows for equality checking
Thursday, May 22, 14
Backend
jsonb
new storage format for json text data
“binary json”
pros:
✓no need to re-parse data
✓improved indexing support
✓allows for equality checking
cons:
- whitespace munging
- json/jsonb quirkiness
- more disk space on small
json objects
tomorrow afternoon - morissette 256
Thursday, May 22, 14
Backend
jsonb
tomorrow afternoon - morissette 256
json jsonb mongodb
table size 1322MB 1375MB 1666MB
index size 630MB 283MB N/A
single key
index
79MB 58MB 96MB
speed 18.759ms 1.111ms 2ms
https://plus.google.com/+ThomBrownUK/posts/1JizRBGPYBq
Thursday, May 22, 14
Backend
recovery target “immediate”
recovery target tells postgres when to launch
- target time, target xid, target name, all
immediate allows start up as soon as
consistent state reached
Thursday, May 22, 14
So Whats New?
Performance
Administration
SQL
Backend
Future
Thursday, May 22, 14
Future
dynamic background workers
9.3 added background workers
available only at startup
9.4 gives you the ability to start
background workers dynamically, from
SQL
Thursday, May 22, 14
Future
dynamic shared memory
not dynamic shared_buffers! :-(
Thursday, May 22, 14
Future
dynamic shared memory
allows the server to create new shared memory
segments on the fly, for example when
requested by a background worker. also adds
some message passing infrastructure.
not dynamic shared_buffers! :-(
Thursday, May 22, 14
Future
extensible TOAST support
added infrastructure to support external, alternative
compression schemes
Thursday, May 22, 14
Future
replication improvements
wal_level = logical
replica identity
replication slots
logical decoding
greatly expands capabilities of 3rd party replication tools
with an eye on “logical replication”
Friday @ 4:15 | Andres Freund | Changeset Extraction
Thursday, May 22, 14
Fin
Thursday, May 22, 14
Thanks!
Postgres Services
Health Audits
24x7 Monitoring
RemoteDBA Services
Postgres Migrations
more:
@robtreat2
http://xzilla.net
@omniti
http://omniti.com
Thursday, May 22, 14

More Related Content

PDF
Past, Present, and Pachyderm - All Things Open - 2013
PPT
Scaling With Postgres
PPTX
High Performance, High Reliability Data Loading on ClickHouse
PDF
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
PDF
Foreign Data Wrapper Enhancements
PDF
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
KEY
PostgreSQL
PDF
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...
Past, Present, and Pachyderm - All Things Open - 2013
Scaling With Postgres
High Performance, High Reliability Data Loading on ClickHouse
Building ClickHouse and Making Your First Contribution: A Tutorial_06.10.2021
Foreign Data Wrapper Enhancements
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
PostgreSQL
Data warehouse on Kubernetes - gentle intro to Clickhouse Operator, by Robert...

What's hot (20)

PPTX
Materialized Views and Secondary Indexes in Scylla: They Are finally here!
PDF
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
PDF
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
PDF
How to teach an elephant to rock'n'roll
PDF
OSDC 2014: Sebastian Harl - SysDB the system management and inventory collect...
PDF
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
PDF
DATABASE AUTOMATION with Thousands of database, monitoring and backup
PDF
SysDB — The system management and inventory collection service
PDF
Let's scale-out PostgreSQL using Citus (English)
PDF
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
PDF
Performance Evaluation of Cloudera Impala GA
PDF
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
PDF
PostgreSQL Meetup Berlin at Zalando HQ
PDF
PostgreSQL and RAM usage
PDF
[PGDay.Seoul 2020] PostgreSQL 13 New Features
PDF
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
PPTX
DataStax: An Introduction to DataStax Enterprise Search
PPT
Hypertable Berlin Buzzwords
TXT
Quick reference for curl
PPT
Oracle 10g Performance: chapter 00 sampling
Materialized Views and Secondary Indexes in Scylla: They Are finally here!
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
How to teach an elephant to rock'n'roll
OSDC 2014: Sebastian Harl - SysDB the system management and inventory collect...
ClickHouse and the Magic of Materialized Views, By Robert Hodges and Altinity...
DATABASE AUTOMATION with Thousands of database, monitoring and backup
SysDB — The system management and inventory collection service
Let's scale-out PostgreSQL using Citus (English)
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
Performance Evaluation of Cloudera Impala GA
ClickHouse on Kubernetes, by Alexander Zaitsev, Altinity CTO
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL and RAM usage
[PGDay.Seoul 2020] PostgreSQL 13 New Features
MySQL Query Tuning for the Squeemish -- Fossetcon Orlando Sep 2014
DataStax: An Introduction to DataStax Enterprise Search
Hypertable Berlin Buzzwords
Quick reference for curl
Oracle 10g Performance: chapter 00 sampling
Ad

Similar to Postgres 9.4 First Look (20)

PPTX
Dimensional performance benchmarking of SQL
PDF
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
PDF
My Experience Using Oracle SQL Plan Baselines 11g/12c
PDF
Overview of Postgres 9.5
 
PDF
PoC Oracle Exadata - Retour d'expérience
PDF
Oracle SQL Tuning
ODP
Common schema my sql uc 2012
ODP
Common schema my sql uc 2012
PPTX
Oracle Database Performance Tuning Basics
PDF
Aspects of 10 Tuning
PDF
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
PDF
Advanced Query Optimizer Tuning and Analysis
PPTX
Sql and PL/SQL Best Practices I
PDF
My sql 5.7-upcoming-changes-v2
PPTX
Enhancements that will make your sql database roar sp1 edition sql bits 2017
PPTX
LVOUG meetup #4 - Case Study 10g to 11g
PDF
MySQL 5.7 Tutorial Dutch PHP Conference 2015
PDF
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
ODP
Pro PostgreSQL
PDF
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
Dimensional performance benchmarking of SQL
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
My Experience Using Oracle SQL Plan Baselines 11g/12c
Overview of Postgres 9.5
 
PoC Oracle Exadata - Retour d'expérience
Oracle SQL Tuning
Common schema my sql uc 2012
Common schema my sql uc 2012
Oracle Database Performance Tuning Basics
Aspects of 10 Tuning
MariaDB 10.5 new features for troubleshooting (mariadb server fest 2020)
Advanced Query Optimizer Tuning and Analysis
Sql and PL/SQL Best Practices I
My sql 5.7-upcoming-changes-v2
Enhancements that will make your sql database roar sp1 edition sql bits 2017
LVOUG meetup #4 - Case Study 10g to 11g
MySQL 5.7 Tutorial Dutch PHP Conference 2015
MySQL 5.7. Tutorial - Dutch PHP Conference 2015
Pro PostgreSQL
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
Ad

More from Robert Treat (20)

PDF
Advanced Int->Bigint Conversions
PDF
Explaining Explain
PDF
the-lost-art-of-plpgsql
PDF
Managing Chaos In Production: Testing vs Monitoring
PDF
Managing Databases In A DevOps Environment 2016
PDF
Less Alarming Alerts - SRECon 2016
PDF
What Ops Can Learn From Design
PDF
Less Alarming Alerts!
PDF
Big Bad "Upgraded" Postgres
PDF
Managing Databases In A DevOps Environment
PDF
The Essential PostgreSQL.conf
PDF
Pro Postgres 9
PDF
Advanced WAL File Management With OmniPITR
PDF
Scaling with Postgres (Highload++ 2010)
PDF
Intro to Postgres 9 Tutorial
PDF
Check Please!
PDF
Database Scalability Patterns
PDF
A Guide To PostgreSQL 9.0
PDF
Intro to Postgres 8.4 Tutorial
PDF
Intro to pl/PHP Oscon2007
Advanced Int->Bigint Conversions
Explaining Explain
the-lost-art-of-plpgsql
Managing Chaos In Production: Testing vs Monitoring
Managing Databases In A DevOps Environment 2016
Less Alarming Alerts - SRECon 2016
What Ops Can Learn From Design
Less Alarming Alerts!
Big Bad "Upgraded" Postgres
Managing Databases In A DevOps Environment
The Essential PostgreSQL.conf
Pro Postgres 9
Advanced WAL File Management With OmniPITR
Scaling with Postgres (Highload++ 2010)
Intro to Postgres 9 Tutorial
Check Please!
Database Scalability Patterns
A Guide To PostgreSQL 9.0
Intro to Postgres 8.4 Tutorial
Intro to pl/PHP Oscon2007

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Machine learning based COVID-19 study performance prediction
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
GamePlan Trading System Review: Professional Trader's Honest Take
Machine learning based COVID-19 study performance prediction
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Sensors and Actuators in IoT Systems using pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Postgres 9.4 First Look