View this presentation to get an overview of the eight major features in Postgres 9.4. It also includes an overview of the new JSONB data type and infrastructure improvements laying the groundwork for post-9.4 features and the future direction of Postgres feature development.
Whether you are new to Postgres or a veteran PostgreSQL or Postgres Plus Advanced Server user, this presentation will improve your database plans for 2015.
To listen the recording visit EnterpriseDB > Resources > Webcasts > Ondemand webcasts.
Contact sales@enterprisedb.com to schedule a personal overview of Postgres and pricing.
1. What’s New in Postgres 9.4
BRUCE MOMJIAN
December, 2014
POSTGRESQL is an open-source, full-featured relational database.
This presentation gives an overview of the Postgres 9.4 release.
Creative Commons Attribution License http://momjian.us/presentations
1 / 21
2. PostgreSQL the database…
I Open Source Object Relational DBMS since 1996
I Distributed under the PostgreSQL License
I Similar technical heritage as Oracle, SQL Server & DB2
I However, a strong adherence to standards (ANSI-SQL 2008)
I Highly extensible and adaptable design
I Languages, indexing, data types, etc.
I E.g. PostGIS, JSONB, SQL/MED
I Extensive use throughout the world for applications and
organizations of all types
I Bundled into Red Hat Enterprise Linux, Ubuntu, CentOS
and Amazon Linux
What’s New in Postgres 9.4 2 / 21
3. PostgreSQL the community…
I Independent community led by a Core Team of six
I Large, active and vibrant community
I www.postgresql.org
I Downloads, Mailing lists, Documentation
I Sponsors sampler:
I Google, Red Hat, VMWare, Skype, Salesforce, HP and
EnterpriseDB
I http://www.postgresql.org/community/
What’s New in Postgres 9.4 3 / 21
4. EnterpriseDB the company…
I The worldwide leader of Postgres based products and
services founded in 2004
I Customers include 50 of the Fortune 500 and 98 of the
Forbes Global 2000
I Enterprise offerings:
I PostgreSQL Support, Services and Training
I Postgres Plus Advanced Server with Oracle Compatibility
I Tools for Monitoring, Replication, HA, Backup & Recovery
Community
I Citizenship
I Contributor of key features: Materialized Views, JSON, &
more
I Nine community members on staff
What’s New in Postgres 9.4 4 / 21
6. 9.4 Feature Outline
1. Allow materialized views to be refreshed without blocking reads
2. Logical decoding allows database changes to be streamed out
in a customizable format
3. Allow background workers to be dynamically registered, started
and terminated
4. Add structured (non-text) data type (JSONB) for storing JSON
data
5. Add SQL-level ALTER SYSTEM command to edit the
postgresql.conf configuration file
6. GIN indexes are 5x smaller and faster for multi-key lookups
7. Improve WAL performance
8. User-configurable delay of streaming replication
Released 2014
What’s New in Postgres 9.4 6 / 21
7. 1. Allow Non-Blocking Materialized View Refresh
I Allows materialized view refresh without blocking reads
I Enabled with CONCURRENTLY keyword
I Requires a unique index
REFRESH MATERIALIZED VIEW CONCURRENTLY matview_test_view;
What’s New in Postgres 9.4 7 / 21
8. 2.Logical Decoding
Logical decoding allows database changes to be optionally
streamed in a configurable format. The data is read from the
WAL and transformed into the desired target format, which can
be easily processed by external tools. In previous releases, only
binary changes were recorded in the WAL. This will be used for
multi-master replication, zero-downtime major upgrades, write
auditing, cache invalidation, and finer-grained replication control.
What’s New in Postgres 9.4 8 / 21
9. 2.Logical Decoding Example
In postgresql.conf:
wal_level = logical
max_replication_slots = 1
From SQL:
SELECT * FROM pg_create_logical_replication_slot(’regression_slot’,
’test_decoding’);
slot_name | xlog_position
-----------------+---------------
regression_slot | 0/16E63E0
What’s New in Postgres 9.4 9 / 21
10. 2.Logical Decoding Example
CREATE TABLE data(id serial primary key, data text);
BEGIN;
INSERT INTO data(data) VALUES(’1’);
INSERT INTO data(data) VALUES(’2’);
COMMIT;
SELECT * FROM pg_logical_slot_get_changes(’regression_slot’, NULL, NULL);
location | xid | data
-----------+-----+---------------------------------------------------------
0/16E6410 | 688 | BEGIN 688
0/16F7F70 | 688 | COMMIT 688
0/16F8080 | 689 | BEGIN 689
0/16F8080 | 689 | table public.data: INSERT: id[integer]:1 data[text]:’1’
0/16F8148 | 689 | table public.data: INSERT: id[integer]:2 data[text]:’2’
0/16F8218 | 689 | COMMIT 689
What’s New in Postgres 9.4 10 / 21
11. 3. Dynamic Control of Background Workers
I Registered
I Started
I Terminated
I Also shared memory dynamic control and message queue
support
This will be used to support parallel query.
What’s New in Postgres 9.4 11 / 21
12. 4. Binary JSON Support (JSONB)
I Allows rapid access to JSON keys and values
I Flexible indexing options, including indexing of all keys and
values (the default), or all key/value combinations
(jsonb_path_ops)
CREATE TABLE json_demo(data JSONB);
CREATE INDEX i_json_demo ON json_demo USING gin (data);
What’s New in Postgres 9.4 12 / 21
13. 5. SQL Control of postgresql.conf
This allows postgresql.conf values to be modified via SQL.
SHOW work_mem;
work_mem
----------
4MB
ALTER SYSTEM SET work_mem = ’30MB’;
SELECT pg_reload_conf();
-- postgresql.conf settings are pushed to running sessions
SHOW work_mem;
work_mem
----------
30MB
What’s New in Postgres 9.4 13 / 21
14. 6. GIN Indexes Are Smaller and Faster
I Typical index shrank from 58MB to 11MB using varbyte
encoding of item pointers
I Advantages of bitmap indexes, without the limitations
I When doing AND index matches, rare items are looked up
first, reducing lookups of more common values
What’s New in Postgres 9.4 14 / 21
15. 7. Improve WAL Performance
I Allow parallel inserts into WAL
I Only write modified fields into WAL, rather than entire rows
What’s New in Postgres 9.4 15 / 21
16. 8. User-Configurable Delay of Streaming Replication
I Controlled by recovery_min_apply_delay
I Useful for recovering from mistakes
What’s New in Postgres 9.4 16 / 21
18. PostgreSQL Evolution
1996
1986
Crash SQL Standards Enterprise Flexibility
2001
1998
2012
13 Years
Flexibility includes:
I Application-specific data types, e.g. JSON, PostGIS, range
types
I Advanced index types, e.g. GIN, SP-GiST
I Single and multi-node scalability
What’s New in Postgres 9.4 18 / 21
19. Three Focuses
Keith Alsheimer, EnterpriseDB
What’s New in Postgres 9.4 19 / 21
20. Additional Resources…
I Postgres Downloads:
I www.enterprisedb.com/downloads
I Product and Services information:
I info@enterprisedb.com
What’s New in Postgres 9.4 20 / 21