You are on page 1of 46

The Future of PostgreSQL 9.2, 9.

3 and beyond

The Future's So Bright ...


Josh Berkus PostgreSQL Experts PostgreSQL Core Team FOSS4G-NA 2012
Photo courtesy The Linux Foundation. All rights reserved.

1986-2011 25 Years of Postgres

1998: 6 contributors

2008: 200 contributors

photo Michael Glaesman, 2008. used under the CC Non-commercial License

2001: Post-What? 2011: No. 4 RDBMS worldwide

2015?

Performance & Scalability

9.2: major features


Performance Improvements Scalability Improvements Cascading Replication JSON and Range Type SP-GiST

Timelines
9.2 beta: 3 weeks from now 9.2: September 2012 9.3: July or September 2013

Performance & Scalability Features


index-only scans group commit fast path sorting heap hot search buffer reduce overhead for shared table locks lazy vxid locks reduced CPU wakeups

Index-Only Scans
3ms
A H N S U A C D H I N R S T U W Col Cos Dea Dem Hea Het Rea Res Ska Sut Tab The Uvh Woz table books
Title Will There Be Faith? State of Wonder Sphere 18c Flr Dead Eyes The Greatest Music Stories Never Told Skeleton Canyon The Long Snapper Super Immunity The Barbary Pirates Heat Confessions of a Prairie Bitch Talking Pictures Reggie Jackson

3000ms

Index-Only Scans
A C D A H N S U H I N R S T U W Col Cos Dea Dem Hea Het Rea Res Ska Sut Tab The Uvh Woz

30ms

Visibility Map

Vertical Scalability
read queries scale to 64 cores write scalability scales to 32 cores copy/bulk insert scalability

Read Scalability

350,000 q.p.s.

Write Scalability

+50% more writes/second

Bulk Load Scalability

10-15 parallel streams

9.3 and Beyond


More write scalability
reducing

transaction log delay and

locking 128 cores? doubling writes/second

PostgreSQL Replication
7.4: external replication (Slony) 8.3: Warm Standby 9.0: Async. Binary Replication 9.1: Synchronous Replication 9.2: Cascading Replication 9.3+ Multimaster Replication?

Cascading Replication

walsender

walreciever

walreciever

walreciever

Cascading Replication
San Francisco North Carolina

walsender

walsender

walreciever

walreciever

walreciever

Replication Improvements
pg_receivexlog an xlog stream reader standby-only backup recv vs. write modes for synchronous replication

9.3 plus: multi-master


Binary MM? PostgresXC?
like

OracleRAC

Postgres-R/translattice? Something else?

Weird Data

we love weird data!


1997: tcp/ip network data 2001: spatial data 2002: arrays, full-text 2008: XML 2010: HStore

9.2: JSON data type


JSON validation text-to-JSON, array-to-JSON
get

your query results as JSON!

JSON <==> Hstore

PL/v8
Based on Google's v8 JS engine write fast stored procedures in JavaScript create ad-hoc attribute indexes on JSON data

Range Types
Temporal range: [ 2012-04-10, 2012-04-12 ) Alpha Index: ( Abbe, Babel ] Linear distance: ( 375.453, 374.441 )

Indexing
7.1: Generic Search Tree (GiST) 8.1: Generalized Inverted Index (GIN) 9.1: K-Nearest Neighbor (KNN)

9.2: Space-GiST

SP-GiST
Based on Space-Partitioning Trees Faster to read, faster to update than GiST Will cause PostGIS 2.1!

SP-GiST
knn=#createindexpt_gist_idxongeo usinggist(point); CREATEINDEX Time:36672.283ms Size:153,124,864 knn=#createindexpt_spgist_idxongeo usingspgist(point); CREATEINDEX Time:12805.530ms~3timesfaster! Size:153,788,416~thesamesize

9.3 and Beyond


Path indexing for JSON, XML Indexed similarity searching 3D and 4D spatial objects?

Foreign Data Wrappers

9.1: FDW

FDW FDR FDW

FDW

9.2: More FDW


Statistics on Foreign Tables Custom Column Options PGSQL-FDW
with

qual pushdown

9.3plus: Full Federation


JOIN push-down
parallel

query across many servers collections

Exotic FDWs
document shapefiles

Writeable FDWs?

More 9.2 Features


Parallel pg_dump
dump

and reload DB 4X faster

Lots of admin improvements


new

admin views new tools

More 9.3 Features


Disk-page checksum
no

more corrupt data

Command triggers
DDL

triggers arbitrary assert triggers

9.3 or so
better virtualization support
managability sharing

system resources

GPU support
parallel

GPU query spatial GPU queries

Beyond 9.3

this cartoon and title slide by Chris Lowrance

We are Pluggable
FDW: query anything! Pluggable Languages
12

and counting

Extensions
PostGIS www.pgxn.org

We can be more Pluggable


Pluggable parser
query

Postgres in different languages

javascript/JSON SQL:Alchemy

Pluggable storage
in-memory column

stores

PostgreSQL: The Linux Of Databases

More Information
Josh Berkus
josh@pgexperts.com www.databasesoup.com

pgExperts
pgexperts.com

PostgreSQL
www.postgresql.org http://www.postgresql.org

Events
pgCon:

/docs/devel/static/

Ottawa, May 14-19 pgOpen: Chicago, Sept. 14-17

Postgres/PostGIS performance BOF: Wednesday 3:30PM


Text and graphics of this talk are licensed Creative Commons Share-Alike, except where otherwise noted. Many photos in the presentation are used with permission and may not be reproduced or redistributed without permission of their owners. Graphs courtesy Robert Haas and Heikki Linnakangas.

You might also like