PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical...
Transcript of PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical...
![Page 1: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/1.jpg)
PostgreSQL: present and near future
![Page 2: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/2.jpg)
1/Less obvious than it should
![Page 3: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/3.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/4.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/5.jpg)
● Locking● Indexes● Storage optimized for lots of datatypes● ...
1.3/And much, much more
![Page 6: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/6.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/7.jpg)
2/What's new in 9.6
![Page 8: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/8.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/9.jpg)
2.1.1/Multiple standby servers – replication
![Page 10: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/10.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/11.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/12.jpg)
● Checksums● WAL● synchronous_comit = on/of
2.4/Durability
![Page 13: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/13.jpg)
RAM
2.4.1/Durability - Architecture
Durablestorage
PostgresSharedmemory
Client
FilesystemCache
Structured data
WAL: Write Ahead Log
![Page 14: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/14.jpg)
3/What's the community working on for v10?
![Page 15: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/15.jpg)
● 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 futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/16.jpg)
3.1.1/Quorum commit
![Page 17: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/17.jpg)
● AUTONOMOUS TRANSACTIONS
3.2/SQL completeness
![Page 18: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/18.jpg)
● CREATE INDEX – sorting● Bitmap scans● Index scans● Asynchronous execution
3.3/Parallel queries
![Page 19: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/19.jpg)
● Amcheck – tool to check the correctness of data● pg_heal
3.4/Durability
![Page 20: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/20.jpg)
● Sorting improvements● Constant evaluation improvements● Fetching several tuples “at once”
3.5/Performance
![Page 21: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/21.jpg)
4/What should Tryton be using but isn't and what can we learn?
![Page 22: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/22.jpg)
● Unaccent● Full text search● Trigram indexes for LIKE searches
4.1/Texts and searching
![Page 23: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/23.jpg)
● How do we create indexes which are not re-done on update?
4.2/Better indexes
![Page 24: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/24.jpg)
● 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 26: PostgreSQL: present and near futuredownloads.tryton.org/TUB2016/postgresql.pdf · Logical replication – pglogical in core ... 3.3/Parallel queries Amcheck – tool to check the](https://reader036.fdocuments.in/reader036/viewer/2022063000/5f0ce9d37e708231d437c069/html5/thumbnails/26.jpg)