postgresql: present and near futureenterprisedb – robert haas – helped amazon build rds...

26
PostgreSQL: present and near future

Upload: others

Post on 21-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

PostgreSQL: present and near future

Page 2: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

1/Less obvious than it should

Page 3: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● SQL is much more than a language to acces your database: SQL allows you to forget about which is the most efficient way to obtain the data you need in a large dataset.

1.1/SQL sucks! Let's use semething new!

Page 4: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● We usually compare PostgreSQL to Oracle as if that was the opponent to beat, but try to CREATE TABLE inside a transaction in Oracle...

1.2/Transactions don't look the same everywhere

Page 5: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Locking● Indexes● Storage optimized for lots of datatypes● ...

1.3/And much, much more

Page 6: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● EnterpriseDB – Robert Haas – Helped Amazon build RDS● 2ndQuadrant – Simon Riggs – Developers around the

world working on key core features● Citus – Andres Freund – CitusDB: clustered PostgreSQL● PostgreSQL Professional – Oleg Bartunov – Full Text

Search● Nippon Telegraph & Telephone...● Tom Lane● ...

1.4/...including an encredible (and profitable) community

Page 7: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

2/What's new in 9.6

Page 8: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● A lot of work has gone in recent versions to make PostgreSQL highly scalable (vertically) by optimizing locked codeblocks.

● Multiple standby servers● postgres_fdw

2.1/Scalability

Page 9: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

2.1.1/Multiple standby servers – replication

Page 10: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Previously only one processor/core could be used per query. Now it can be used in sequential scans, joins and aggregates.

2.2/Parallel queries

Page 11: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● CUBE, ROLLUP, GROUPING SETS● WITH & WITH RECURSIVE● MATERIALIZED VIEWS● Full text search● Row-level security● JSONB

2.3/SQL completeness

Page 12: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Checksums● WAL● synchronous_comit = on/of

2.4/Durability

Page 13: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

RAM

2.4.1/Durability - Architecture

Durablestorage

PostgresSharedmemory

Client

FilesystemCache

Structured data

WAL: Write Ahead Log

Page 14: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

3/What's the community working on for v10?

Page 15: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Even more scalability work (large number of cores and clients required for testing)

● Quorum commit● Logical replication – pglogical in core● Pushing more stuf into postgres_fdw

3.1/Scalability

Page 16: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

3.1.1/Quorum commit

Page 17: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● AUTONOMOUS TRANSACTIONS

3.2/SQL completeness

Page 18: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● CREATE INDEX – sorting● Bitmap scans● Index scans● Asynchronous execution

3.3/Parallel queries

Page 19: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Amcheck – tool to check the correctness of data● pg_heal

3.4/Durability

Page 20: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Sorting improvements● Constant evaluation improvements● Fetching several tuples “at once”

3.5/Performance

Page 21: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

4/What should Tryton be using but isn't and what can we learn?

Page 22: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● Unaccent● Full text search● Trigram indexes for LIKE searches

4.1/Texts and searching

Page 23: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● How do we create indexes which are not re-done on update?

4.2/Better indexes

Page 24: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

● PostgreSQL has lots of tools to try to understand what's going on.

4.3/To learn: tools to know what's going on

Page 25: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features

http://www.NaN-tic.com

Albert Cervera i [email protected]@albertnanlinkedin.com/in/albertca

Page 26: PostgreSQL: present and near futureEnterpriseDB – Robert Haas – Helped Amazon build RDS 2ndQuadrant – Simon Riggs – Developers around the world working on key core features