92 and Beyond

Embed Size (px)

Citation preview

  • 7/29/2019 92 and Beyond

    1/46

    The Future of PostgreSQL

    9.2, 9.3 and beyond

  • 7/29/2019 92 and Beyond

    2/46

    The

    Future'sSo

    Bright ...

    Photo courtesy The Linux Foundation. All rights reserved.

    Josh BerkusPostgreSQL ExpertsPostgreSQL Core TeamFOSS4G-NA 2012

  • 7/29/2019 92 and Beyond

    3/46

  • 7/29/2019 92 and Beyond

    4/46

    1986-2011

    25 Years

    of Postgres

  • 7/29/2019 92 and Beyond

    5/46

    1998: 6 contributors

  • 7/29/2019 92 and Beyond

    6/46

    2008: 200 contributors

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

  • 7/29/2019 92 and Beyond

    7/46

    2001: Post-What?

    2011: No. 4 RDBMS

    worldwide

  • 7/29/2019 92 and Beyond

    8/46

    2015?

  • 7/29/2019 92 and Beyond

    9/46

    Performance & Scalability

  • 7/29/2019 92 and Beyond

    10/46

    9.2: major features

    Performance Improvements

    Scalability Improvements

    Cascading Replication

    JSON and Range Type

    SP-GiST

  • 7/29/2019 92 and Beyond

    11/46

    Timelines

    9.2 beta: 3 weeks from now

    9.2: September 2012

    9.3: July or September 2013

  • 7/29/2019 92 and Beyond

    12/46

    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

    -

  • 7/29/2019 92 and Beyond

    13/46

    Index-Only Scans

    AHNSU

    ACD

    NR

    UW

    ST

    H

    I

    Col

    Cos

    DeaDem

    Hea

    Het

    ReaRes

    Ska

    Sut

    TabThe

    Uvh

    Woz

    Title

    Will There Be Faith?

    State of Wonder

    Sphere 18c Flr

    Dead Eyes

    The Greatest MusicStories Never Told

    Skeleton Canyon

    The Long Snapper

    Super Immunity

    The Barbary Pirates

    Heat

    Confessions of aPrairie Bitch

    Talking Pictures

    Reggie Jackson

    table books

    3ms

    3000ms

  • 7/29/2019 92 and Beyond

    14/46

    Index-Only Scans

    AHNSU

    ACD

    NR

    UW

    ST

    H

    I

    Col

    Cos

    DeaDem

    Hea

    Het

    ReaRes

    Ska

    Sut

    TabThe

    Uvh

    Woz

    30ms

    Visibility

    Map

  • 7/29/2019 92 and Beyond

    15/46

    Vertical Scalability

    read queries scale to 64 cores

    write scalability scales to 32

    corescopy/bulk insert scalability

  • 7/29/2019 92 and Beyond

    16/46

    Read Scalability

    350,000 q.p.s.

  • 7/29/2019 92 and Beyond

    17/46

    Write Scalability

    +50% more

    writes/second

  • 7/29/2019 92 and Beyond

    18/46

    Bulk Load Scalability

    10-15 parallel streams

  • 7/29/2019 92 and Beyond

    19/46

    9.3 and Beyond

    More write scalability reducing transaction log delay and

    locking

    128 cores?

    doubling writes/second

  • 7/29/2019 92 and Beyond

    20/46

    PostgreSQL Replication

    7.4: external replication (Slony)

    8.3: Warm Standby

    9.0: Async. Binary Replication

    9.1: Synchronous Replication

    9.2: Cascading Replication9.3+ Multimaster Replication?

  • 7/29/2019 92 and Beyond

    21/46

    Cascading Replication

    walsender

    walreciever

    walreciever

    walreciever

  • 7/29/2019 92 and Beyond

    22/46

    Cascading Replication

    walsender

    walreciever

    walreciever

    walreciever

    walsender

    San Francisco North Carolina

  • 7/29/2019 92 and Beyond

    23/46

    Replication Improvements

    pg_receivexlogan xlog stream reader

    standby-only backuprecv vs. write modes

    for synchronous replication

  • 7/29/2019 92 and Beyond

    24/46

    9.3 plus: multi-master

    Binary MM?

    PostgresXC?

    like OracleRACPostgres-R/translattice?

    Something else?

  • 7/29/2019 92 and Beyond

    25/46

    Weird Data

  • 7/29/2019 92 and Beyond

    26/46

    we love weird data!

    1997: tcp/ip network data

    2001: spatial data

    2002: arrays, full-text2008: XML

    2010: HStore

  • 7/29/2019 92 and Beyond

    27/46

    9.2: JSON data type

    JSON validation

    text-to-JSON, array-to-JSON

    get your query results as JSON!JSON Hstore

  • 7/29/2019 92 and Beyond

    28/46

    PL/v8

    Based on Google's v8 JS engine

    write fast stored procedures in

    JavaScriptcreate ad-hoc attribute indexes

    on JSON data

  • 7/29/2019 92 and Beyond

    29/46

    Range Types

    Temporal range:[ 2012-04-10, 2012-04-12 )

    Alpha Index:( Abbe, Babel ]

    Linear distance:

    ( 375.453, 374.441 )

  • 7/29/2019 92 and Beyond

    30/46

    Indexing

    7.1: Generic Search Tree(GiST)

    8.1: Generalized Inverted Index(GIN)

    9.1: K-Nearest Neighbor

    (KNN)

  • 7/29/2019 92 and Beyond

    31/46

    9.2: Space-GiST

  • 7/29/2019 92 and Beyond

    32/46

    SP-GiST

    Based on Space-PartitioningTrees

    Faster to read, faster to updatethan GiST

    Will cause PostGIS 2.1!

  • 7/29/2019 92 and Beyond

    33/46

    SP-GiST

    knn=# create index pt_gist_idx on geousing gist(point);

    CREATE INDEX

    Time: 36672.283 ms

    Size: 153,124,864

    knn=# create index pt_spgist_idx on geousing spgist(point);

    CREATE INDEXTime: 12805.530 ms ~ 3 times faster !

    Size: 153,788,416 ~ the same size

  • 7/29/2019 92 and Beyond

    34/46

    9.3 and Beyond

    Path indexing for JSON, XML

    Indexed similarity searching

    3D and 4D spatial objects?

  • 7/29/2019 92 and Beyond

    35/46

    Foreign Data Wrappers

  • 7/29/2019 92 and Beyond

    36/46

    9.1: FDW

    FDR

    FDW

    FDW

    FDW

  • 7/29/2019 92 and Beyond

    37/46

    9.2: More FDW

    Statistics on Foreign Tables

    Custom Column Options

    PGSQL-FDWwith qual pushdown

  • 7/29/2019 92 and Beyond

    38/46

    9.3plus: Full Federation

    JOIN push-downparallel query across many servers

    Exotic FDWsdocument collections

    shapefiles

    Writeable FDWs?

    M 9 2 F

  • 7/29/2019 92 and Beyond

    39/46

    More 9.2 Features

    Parallel pg_dumpdump and reload DB 4X faster

    Lots of admin improvementsnew admin views

    new tools

    M 9 3 F

  • 7/29/2019 92 and Beyond

    40/46

    More 9.3 Features

    Disk-page checksumno more corrupt data

    Command triggersDDL triggers

    arbitrary assert triggers

    9 3

  • 7/29/2019 92 and Beyond

    41/46

    9.3 or so

    better virtualization supportmanagability

    sharing system resourcesGPU support

    parallel GPU query

    spatial GPU queries

    B 9 3

  • 7/29/2019 92 and Beyond

    42/46

    Beyond 9.3

    this cartoon and title slide by Chris Lowrance

    W P

  • 7/29/2019 92 and Beyond

    43/46

    We are Pluggable

    FDW: query anything!

    Pluggable Languages12 and counting

    Extensions

    PostGISwww.pgxn.org

    We can be more

  • 7/29/2019 92 and Beyond

    44/46

    We can be more

    Pluggable

    Pluggable parserquery Postgres in different languages

    javascript/JSON

    SQL:Alchemy

    Pluggable storage in-memory

    column stores

  • 7/29/2019 92 and Beyond

    45/46

    PostgreSQL:

    The LinuxOf Databases

    More Information

  • 7/29/2019 92 and Beyond

    46/46

    More Information

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

    Josh [email protected]

    www.databasesoup.com

    PostgreSQLwww.postgresql.org

    http://www.postgresql.org/docs/devel/static/

    pgExpertspgexperts.com

    Events

    pgCon: Ottawa,May 14-19

    pgOpen: Chicago,Sept. 14-17

    Postgres/PostGIS performance BOF:Wednesday 3:30PM