SlideShare a Scribd company logo
PostgreSQL 9.4 Sneak Peek
Pavan Deolasee
March 28, 2014
India PostgreSQL User Group Meetup
Hyderabad
Who am I ?

Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

PostgreSQL/Postgres-XC Consultant

Contributor to PostgreSQL and Postgres-XC Global
Development
Best known for development of Heap-Only-Tuple (HOT)
feature
Contributed several other enhancements to PostgreSQL
and derivatives
Contributed to Postgres-XC's architectural design and
implementation of several features

Previously worked for EnterpriseDB and Symantec/Veritas
PostgreSQL Recap
• is world's most advanced open source database
• is very stable
• is fully compliant with ANSI SQL
• supports foreign key, check constraints
• supports various kinds of indexes
• supports inheritance
• Is fully extensible (data types, procedural languages
etc)
• supports ACID transactions
• will recover your database in case of server failure
PostgreSQL Recap
• uses write-ahead-logs for durability and recover your
database in case of
• server failure
• built-in log based streaming
synchronous/asynchronous replication
• file system level backups and archive recovery
• point-in-time recovery
• hot standby
• upgrade in place
• full-text search
• and many more
Configuration/Admin
• Read-only GUC to show if data checksum is enabled or not
– Useful to know if the server is initialized with data
checksums on/off.
– Previously, user must look at pg_control to get this
information
• New autovacuum_work_mem parameter
– Separates it from the work_mem parameter
• A GUC to enable WAL-logging of hint bits, even with
checksums disabled.
– Turn this on if you want to use external tools such as
pg_rewind to quickly get you old master join the
replication as a new standby
– More WAL generated, so be aware of the performance
impact
Configuration/Admin
• A GUC, max_worker_processes, limiting number of
bgworkers.
• A GUC, session_preload_libraries, specifying preload
libraries at session startup
– Takes effect at backend start
– Doesn’t require a full server restart
• A new pg_stat_archiver statistics view.
• Improve EXPLAIN to print the grouping columns in Agg
and Group nodes.
• Default work_mem and maintenance_work_mem
increased by 4x
SQL Improvements
• Revive line type
CREATE TABLE LINE_TBL (s line);
• Represented by
• Equation Ax + By + C = 0
INSERT INTO LINE_TBL VALUES ('{1,-1,1}');
• Two points (x1, y1), (x2, y2)
INSERT INTO LINE_TBL VALUES ('(0,0),(6,6)');
SQL Improvements
• Allow only some columns of a view to be auto-
updateable.
CREATE TABLE base_tbl(a float);
CREATE VIEW rw_view1 AS
SELECT ctid, sin(a) s, a, cos(a) c
FROM base_tbl WHERE a != 0;
INSERT INTO rw_view1 VALUES (null, null, 1.1, null);
-- should fail
INSERT INTO rw_view1 (a) VALUES (1.1) RETURNING a, s, c;
-- OK
UPDATE rw_view1 SET s = s WHERE a = 1.1;
-- should fail
SQL Improvements
• Materialized Views - Support for REFRESH
CONCURRENTLY
– Readers won’t be blocked while a MatView is being
refreshed
• WITH CHECK OPTION support for auto-updatable
VIEWs
– INSERTs/UPDATEs not satisfying the view visibility will
be rejected
– LOCAL CHECK only checks against the current view
– CASCADE CHECK checks against all the underlying
views
SQL Improvements
• Provide a FORCE NULL option to COPY in CSV mode.
– Forces an input field containing the quoted null string
to be returned as a NULL. Without this option, only
unquoted null strings behave this way.
– Helps where some CSV producers insist on quoting
every field, whether or not it is needed.
– Takes a list of fields, and only applies to those columns.
CREATE TEMP TABLE forcetest (a INT NOT NULL, b
TEXT NOT NULL, c TEXT, d TEXT, e TEXT);
pset null NULL
COPY forcetest (a, b, c) FROM STDIN WITH
(FORMAT csv, FORCE_NOT_NULL(b),
FORCE_NULL(c));
SQL Improvements
• DISCARD SEQUENCES command.
– Will discard cached values for sequences
• Allow empty target list in SELECT
• WITHIN GROUP and ordered-set aggregates
• Support multi-argument UNNEST(), and
TABLE() syntax for multiple functions.
Developer Features
• Improve support for building PGXS modules with
VPATH.
• Use an MVCC snapshot, rather than SnapshotNow, for
catalog scans.
• Dynamic background worker threads
• Allow background workers to be started dynamically.
• Single-reader, single-writer, lightweight shared
message queue.
• Allow on-detach callbacks for dynamic shared memory
segments.
Security
• SSL: Add configuration option to prefer server
cipher order
• SSL: Support ECDH key exchange
• Rework SSL renegotiation code
Performance
• Change the way tuples are marked as frozen.
– Xmin is preserved for forensic analysis and debugging.
– Allows aggressive freezing of tuples without fear of
lossing critical debugging information
• Aggressively freeze tables when CLUSTER or VACUUM
FULL rewrites them.
• Include planning time in EXPLAIN ANALYZE output.
• Improve performance of numeric sum(), avg(),
stddev(), variance(), etc.
• Improve performance of COPY with default nextval()
Performance
• Only WAL-log the modified portion in an
UPDATE, if possible.
• Improve scalability of WAL insertions.
• Allow using huge TLB pages on Linux
(MAP_HUGETLB)
• Speed up "rare & frequent" type GIN queries.
Replication
• Allow time delayed standbys and recovery
– Set min_recovery_apply_delay to force a delay
in recovery apply
– Delay is measured between WAL record time
and local standby time.
• If multiple recovery_targets are specified, use
the latest one.
Logical Replication (WIP)
• Introduce logical decoding.
– Fine granular replication
– Bi-directional replication
• Add new wal_level, logical, sufcient for
logical decoding.
• Add the notion of REPLICA IDENTITY for a
table.
• Allow logical decoding via the walsender
interface.
Resources
• Release Notes
• Planet PostgreSQL
• Documentation
• Source Code
3/30/14 18
Thank you
Pavan Deolasee
pavan.deolasee@gmail.com
http://www.linkedin.com/in/pavandeolasee
3/30/14 19

More Related Content

PDF
What’s New In PostgreSQL 9.3
PDF
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
PDF
Postgres-XC: Symmetric PostgreSQL Cluster
PDF
What's New in PostgreSQL 9.6
 
PPTX
Percona FT / TokuDB
PPTX
PostgreSQL as an Alternative to MSSQL
PDF
Scylla Summit 2016: Outbrain Case Study - Lowering Latency While Doing 20X IO...
PDF
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
What’s New In PostgreSQL 9.3
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Postgres-XC: Symmetric PostgreSQL Cluster
What's New in PostgreSQL 9.6
 
Percona FT / TokuDB
PostgreSQL as an Alternative to MSSQL
Scylla Summit 2016: Outbrain Case Study - Lowering Latency While Doing 20X IO...
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor

What's hot (20)

PPTX
Brk2051 sql server on linux and docker
PPTX
Product Update: EDB Postgres Platform 2017
 
PDF
Query Parallelism in PostgreSQL: What's coming next?
PDF
Geographically Distributed PostgreSQL
PDF
Migrating Oracle database to PostgreSQL
PDF
Chicago Kafka Meetup
PPTX
Products.intro.forum version
PPT
Postgres Presentation
PPTX
One Tool to Rule Them All- Seamless SQL on MongoDB, MySQL and Redis with Apac...
PDF
PostgreSQL 9.6 Performance-Scalability Improvements
PDF
State transfer With Galera
PDF
PostgreSQL HA
PDF
Distribute Key Value Store
PDF
PGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan Pachenko
PPTX
Building Spark as Service in Cloud
PPTX
Monitoring MongoDB’s Engines in the Wild
PDF
Exadata Deployment Bare Metal vs Virtualized
PDF
Cassandra Introduction & Features
PDF
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PDF
Cassandra: An Alien Technology That's not so Alien
Brk2051 sql server on linux and docker
Product Update: EDB Postgres Platform 2017
 
Query Parallelism in PostgreSQL: What's coming next?
Geographically Distributed PostgreSQL
Migrating Oracle database to PostgreSQL
Chicago Kafka Meetup
Products.intro.forum version
Postgres Presentation
One Tool to Rule Them All- Seamless SQL on MongoDB, MySQL and Redis with Apac...
PostgreSQL 9.6 Performance-Scalability Improvements
State transfer With Galera
PostgreSQL HA
Distribute Key Value Store
PGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan Pachenko
Building Spark as Service in Cloud
Monitoring MongoDB’s Engines in the Wild
Exadata Deployment Bare Metal vs Virtualized
Cassandra Introduction & Features
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
Cassandra: An Alien Technology That's not so Alien
Ad

Viewers also liked (20)

PDF
PGconf India 2017 - Closing Note
PDF
PostgreSQL DBA Neler Yapar?
PDF
Founding a LLC in Turkey
PDF
TTÜ Geeky Weekly
PDF
PostgreSQL Hem Güçlü Hem Güzel!
PDF
PostgreSQL'i öğrenmek ve yönetmek
PDF
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
PPTX
LUG-BG - Kostadin Slavkov - PostgreSQL 10
PDF
10 things, an Oracle DBA should care about when moving to PostgreSQL
PDF
Entrepreneurship Reflective Learning Diary
PDF
Go Faster With Native Compilation
PDF
pgDay Asia 2016 & 2017
PDF
(Ab)using 4d Indexing
PDF
Big Data and PostgreSQL
PDF
PostgreSQL performance improvements in 9.5 and 9.6
PPTX
PostgreSQL 10: What to Look For
PDF
Introduction to Vacuum Freezing and XID
PDF
PostgreSQL: Past present Future
PDF
PostgreSQL Enterprise Class Features and Capabilities
PDF
Swapping Pacemaker Corosync with repmgr
PGconf India 2017 - Closing Note
PostgreSQL DBA Neler Yapar?
Founding a LLC in Turkey
TTÜ Geeky Weekly
PostgreSQL Hem Güçlü Hem Güzel!
PostgreSQL'i öğrenmek ve yönetmek
Managing PostgreSQL with Ansible - FOSDEM PGDay 2016
LUG-BG - Kostadin Slavkov - PostgreSQL 10
10 things, an Oracle DBA should care about when moving to PostgreSQL
Entrepreneurship Reflective Learning Diary
Go Faster With Native Compilation
pgDay Asia 2016 & 2017
(Ab)using 4d Indexing
Big Data and PostgreSQL
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL 10: What to Look For
Introduction to Vacuum Freezing and XID
PostgreSQL: Past present Future
PostgreSQL Enterprise Class Features and Capabilities
Swapping Pacemaker Corosync with repmgr
Ad

Similar to What's New In PostgreSQL 9.4 (20)

ODP
PostgreSQL 8.4 TriLUG 2009-11-12
PDF
A Peek in the Elephant's Trunk
 
PDF
PostgreSQL 9.5 - Major Features
PDF
Major features postgres 11
 
PDF
What's New in Postgres 9.4
 
PDF
[PGDay.Seoul 2020] PostgreSQL 13 New Features
PDF
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
PPTX
Modern sql
PDF
Pg 95 new capabilities
PDF
Overview of Postgres 9.5
 
PDF
An evening with Postgresql
PDF
PostgreSQL v9.4features
PDF
Performance improvements in PostgreSQL 9.5 and beyond
PDF
2016 jan-pugs-meetup-v9.5-features
PPTX
PostgreSQL - Object Relational Database
PDF
GSoC2014 - PGDay Ijui/RS Presentation October, 2016
PDF
PostgreSQL News
PDF
Techday2010 Postgresql9
PDF
What's New in PostgreSQL 9.3
 
KEY
Grabbing the PostgreSQL Elephant by the Trunk
PostgreSQL 8.4 TriLUG 2009-11-12
A Peek in the Elephant's Trunk
 
PostgreSQL 9.5 - Major Features
Major features postgres 11
 
What's New in Postgres 9.4
 
[PGDay.Seoul 2020] PostgreSQL 13 New Features
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
Modern sql
Pg 95 new capabilities
Overview of Postgres 9.5
 
An evening with Postgresql
PostgreSQL v9.4features
Performance improvements in PostgreSQL 9.5 and beyond
2016 jan-pugs-meetup-v9.5-features
PostgreSQL - Object Relational Database
GSoC2014 - PGDay Ijui/RS Presentation October, 2016
PostgreSQL News
Techday2010 Postgresql9
What's New in PostgreSQL 9.3
 
Grabbing the PostgreSQL Elephant by the Trunk

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Well-logging-methods_new................
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Digital Logic Computer Design lecture notes
PPT
Mechanical Engineering MATERIALS Selection
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
OOP with Java - Java Introduction (Basics)
bas. eng. economics group 4 presentation 1.pptx
Sustainable Sites - Green Building Construction
CH1 Production IntroductoryConcepts.pptx
Well-logging-methods_new................
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Operating System & Kernel Study Guide-1 - converted.pdf
UNIT 4 Total Quality Management .pptx
Digital Logic Computer Design lecture notes
Mechanical Engineering MATERIALS Selection
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Lecture Notes Electrical Wiring System Components
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

What's New In PostgreSQL 9.4

  • 1. PostgreSQL 9.4 Sneak Peek Pavan Deolasee March 28, 2014 India PostgreSQL User Group Meetup Hyderabad
  • 2. Who am I ?  Pavan Deolasee http://www.linkedin.com/in/pavandeolasee  PostgreSQL/Postgres-XC Consultant  Contributor to PostgreSQL and Postgres-XC Global Development Best known for development of Heap-Only-Tuple (HOT) feature Contributed several other enhancements to PostgreSQL and derivatives Contributed to Postgres-XC's architectural design and implementation of several features  Previously worked for EnterpriseDB and Symantec/Veritas
  • 3. PostgreSQL Recap • is world's most advanced open source database • is very stable • is fully compliant with ANSI SQL • supports foreign key, check constraints • supports various kinds of indexes • supports inheritance • Is fully extensible (data types, procedural languages etc) • supports ACID transactions • will recover your database in case of server failure
  • 4. PostgreSQL Recap • uses write-ahead-logs for durability and recover your database in case of • server failure • built-in log based streaming synchronous/asynchronous replication • file system level backups and archive recovery • point-in-time recovery • hot standby • upgrade in place • full-text search • and many more
  • 5. Configuration/Admin • Read-only GUC to show if data checksum is enabled or not – Useful to know if the server is initialized with data checksums on/off. – Previously, user must look at pg_control to get this information • New autovacuum_work_mem parameter – Separates it from the work_mem parameter • A GUC to enable WAL-logging of hint bits, even with checksums disabled. – Turn this on if you want to use external tools such as pg_rewind to quickly get you old master join the replication as a new standby – More WAL generated, so be aware of the performance impact
  • 6. Configuration/Admin • A GUC, max_worker_processes, limiting number of bgworkers. • A GUC, session_preload_libraries, specifying preload libraries at session startup – Takes effect at backend start – Doesn’t require a full server restart • A new pg_stat_archiver statistics view. • Improve EXPLAIN to print the grouping columns in Agg and Group nodes. • Default work_mem and maintenance_work_mem increased by 4x
  • 7. SQL Improvements • Revive line type CREATE TABLE LINE_TBL (s line); • Represented by • Equation Ax + By + C = 0 INSERT INTO LINE_TBL VALUES ('{1,-1,1}'); • Two points (x1, y1), (x2, y2) INSERT INTO LINE_TBL VALUES ('(0,0),(6,6)');
  • 8. SQL Improvements • Allow only some columns of a view to be auto- updateable. CREATE TABLE base_tbl(a float); CREATE VIEW rw_view1 AS SELECT ctid, sin(a) s, a, cos(a) c FROM base_tbl WHERE a != 0; INSERT INTO rw_view1 VALUES (null, null, 1.1, null); -- should fail INSERT INTO rw_view1 (a) VALUES (1.1) RETURNING a, s, c; -- OK UPDATE rw_view1 SET s = s WHERE a = 1.1; -- should fail
  • 9. SQL Improvements • Materialized Views - Support for REFRESH CONCURRENTLY – Readers won’t be blocked while a MatView is being refreshed • WITH CHECK OPTION support for auto-updatable VIEWs – INSERTs/UPDATEs not satisfying the view visibility will be rejected – LOCAL CHECK only checks against the current view – CASCADE CHECK checks against all the underlying views
  • 10. SQL Improvements • Provide a FORCE NULL option to COPY in CSV mode. – Forces an input field containing the quoted null string to be returned as a NULL. Without this option, only unquoted null strings behave this way. – Helps where some CSV producers insist on quoting every field, whether or not it is needed. – Takes a list of fields, and only applies to those columns. CREATE TEMP TABLE forcetest (a INT NOT NULL, b TEXT NOT NULL, c TEXT, d TEXT, e TEXT); pset null NULL COPY forcetest (a, b, c) FROM STDIN WITH (FORMAT csv, FORCE_NOT_NULL(b), FORCE_NULL(c));
  • 11. SQL Improvements • DISCARD SEQUENCES command. – Will discard cached values for sequences • Allow empty target list in SELECT • WITHIN GROUP and ordered-set aggregates • Support multi-argument UNNEST(), and TABLE() syntax for multiple functions.
  • 12. Developer Features • Improve support for building PGXS modules with VPATH. • Use an MVCC snapshot, rather than SnapshotNow, for catalog scans. • Dynamic background worker threads • Allow background workers to be started dynamically. • Single-reader, single-writer, lightweight shared message queue. • Allow on-detach callbacks for dynamic shared memory segments.
  • 13. Security • SSL: Add configuration option to prefer server cipher order • SSL: Support ECDH key exchange • Rework SSL renegotiation code
  • 14. Performance • Change the way tuples are marked as frozen. – Xmin is preserved for forensic analysis and debugging. – Allows aggressive freezing of tuples without fear of lossing critical debugging information • Aggressively freeze tables when CLUSTER or VACUUM FULL rewrites them. • Include planning time in EXPLAIN ANALYZE output. • Improve performance of numeric sum(), avg(), stddev(), variance(), etc. • Improve performance of COPY with default nextval()
  • 15. Performance • Only WAL-log the modified portion in an UPDATE, if possible. • Improve scalability of WAL insertions. • Allow using huge TLB pages on Linux (MAP_HUGETLB) • Speed up "rare & frequent" type GIN queries.
  • 16. Replication • Allow time delayed standbys and recovery – Set min_recovery_apply_delay to force a delay in recovery apply – Delay is measured between WAL record time and local standby time. • If multiple recovery_targets are specified, use the latest one.
  • 17. Logical Replication (WIP) • Introduce logical decoding. – Fine granular replication – Bi-directional replication • Add new wal_level, logical, sufcient for logical decoding. • Add the notion of REPLICA IDENTITY for a table. • Allow logical decoding via the walsender interface.
  • 18. Resources • Release Notes • Planet PostgreSQL • Documentation • Source Code 3/30/14 18