SlideShare a Scribd company logo
Performance, Reliability, Flexibility –Pick Any Three!
•JSONB-jsonBinary Storage 
•Replication improvements-Replication Slots 
•Logical Decoding in WAL log 
•Time Lagging Replica 
•pg_prewarm 
•ALTER SYSTEM Command 
•Great new enhancements in aggregation features
Wasn’t JSON was introduced in v9.2? Well it just got better 
JSONB is much more optimized and faster for lookup 
New functions to extract and manipulate the jsondata 
You have the flexibility without compromising on Reliability! 
Non-relational data with ACID compliance!
row_to_json–to convert a row to json 
json_object–Create jsonobject out of text array 
json_build_object–Create jsonobject out of variadicargument list 
array_to_json–to converan array to JSON 
json_eachand json_each_text–convert jsonobjects in key-value pair 
json_extract_path-Get value of a jsonobject 
json_populate_recordand json_populate_recordset-Convert jsonobject to records
Operator 
Operand Type 
Purpose 
-> 
int 
Get JSON arraryelement 
-> 
text 
Get JSON object field 
->> 
int 
Get JSON array element as text 
->> 
text 
Get JSON object fieldas text 
#> 
array of text 
Get JSONobject at specified path 
#>> 
array of text 
Get JSON object at specified path as text 
@> 
jsonb 
Does the left JSON value contain within it the right value? 
<@ 
jsonb 
Is the left JSON value contained within the right value? 
? 
text 
Does the key/elementstringexist within the JSON value? 
?| 
text[] 
Do any of these key/elementstringsexist? 
?& 
text[] 
Do all of these key/elementstringsexist?
JSONB in action!
select data from Table as a jsonobject- 
SELECT 
JSON_BUILD_OBJECT( 'name',name) 
FROM books; 
Convert a row to json 
SELECT ROW_TO_JSON(my_row) 
FROM ( SELECT ROW(books.*) 
FROM books )my_row;
Select output of join as a jsonobject- 
SELECT JSON_BUILD_OBJECT( 'name', name, 'author', name_arr) 
FROM( 
SELECT ARRAY_AGG( a.name ) AS name_arr, b.name AS name 
FROM authors a JOIN author_book_mapab ON a.id=ab.author_id 
JOIN books b ON b.id=ab.book_id 
GROUP BY b.name ) books_authors_join;
Now you need to guess “wal_keep_segment” to avoid walfiles from getting removed 
Simply create a replication slot and WAL which are yet not replicated to the slot will not be removed from live WAL location 
Time Lagging Replica-You can define a lag period for your replica 
This can be used for back-dated reporting 
Or recover from a user error –an accidentally dropped table or a truncated table
Set WAL level to ‘logical’ to do more verbose recoding in WAL files 
This will also record table and relation level details in each WAL entry 
These WAL files can be used for logical decoding and logical replication to replicate changes on a particular table 
There are commercial and open source solutions which are in beta stage and are based on this approach
ALTER SYSTEM Command-Now a DBA can alter the configuration with ALTER SYSTEM command and avoid changing it in postgresql.conf 
pg_prewarm-now a DBA can load certain relations and blocks in cache after startup and avoid performance issues due to cold-reboot
https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4 
Hangout Recording for Replication Features in v9.4- https://www.youtube.com/watch?v=-HkrXwaWCb8 
EnterpriseDB Whitepaper-http://www.enterprisedb.com/nosql-for-enterprise 
http://www.craigkerstiens.com/2014/03/24/Postgres-9.4-Looking-up/ 
Or just mail me… 
sameer.kasi200x@gmail.com 
sameer.kumar@ashnik.com

More Related Content

ODP
BaseX user-group-talk XML Prague 2013
PDF
Benchx: An XQuery benchmarking web application
PDF
Running kubernetes
PPTX
Data file handling in python binary & csv files
PDF
Migrating Legacy Data (Ruby Midwest)
PPTX
MongoDB Aggregation MongoSF May 2011
PDF
Embuk internals
PDF
Cassandra Summit 2014: Reading Cassandra SSTables Directly for Offline Data A...
BaseX user-group-talk XML Prague 2013
Benchx: An XQuery benchmarking web application
Running kubernetes
Data file handling in python binary & csv files
Migrating Legacy Data (Ruby Midwest)
MongoDB Aggregation MongoSF May 2011
Embuk internals
Cassandra Summit 2014: Reading Cassandra SSTables Directly for Offline Data A...

What's hot (20)

PDF
Xephon K A Time series database with multiple backends
PDF
Redis: REmote DIctionary Server
PDF
ETL With Cassandra Streaming Bulk Loading
PDF
Bulk Loading Data into Cassandra
PPT
Upgrading To The New Map Reduce API
PPTX
RethinkDB - the open-source database for the realtime web
PDF
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PDF
Indexes don't mean slow inserts.
PPT
MongoDB @ fliptop
PDF
What is new in MariaDB 10.6?
PPTX
mesos-devoxx14
PDF
patroni-based citrus high availability environment deployment
PDF
Scala+data
PPTX
SORT & JOIN IN SPARK 2.0
PDF
Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)
PPTX
Managing a 14 TB reporting datawarehouse with postgresql
PDF
ClickHouse Deep Dive, by Aleksei Milovidov
PDF
Fighting Against Chaotically Separated Values with Embulk
PDF
Big Data Analytics with Scala at SCALA.IO 2013
PDF
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
Xephon K A Time series database with multiple backends
Redis: REmote DIctionary Server
ETL With Cassandra Streaming Bulk Loading
Bulk Loading Data into Cassandra
Upgrading To The New Map Reduce API
RethinkDB - the open-source database for the realtime web
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
Indexes don't mean slow inserts.
MongoDB @ fliptop
What is new in MariaDB 10.6?
mesos-devoxx14
patroni-based citrus high availability environment deployment
Scala+data
SORT & JOIN IN SPARK 2.0
Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)
Managing a 14 TB reporting datawarehouse with postgresql
ClickHouse Deep Dive, by Aleksei Milovidov
Fighting Against Chaotically Separated Values with Embulk
Big Data Analytics with Scala at SCALA.IO 2013
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
Ad

Viewers also liked (20)

PPTX
Streaming Replication Made Easy in v9.3
PPTX
Tuning your PostgreSQL Database
PPT
1200 j lipman
PDF
Caldwell recognition-2012
PPTX
Bab 5 9d
PPT
P1 L2
PDF
Jill lintner's portfolio
PDF
Hugps138
PPSX
Horizons Beyond Dreams Business Plan
PPTX
Intergenerational Networking
PPT
The Praying Indians of Megunko
PPTX
Cultural strength
PPTX
Las leyes naturales, según Thomas Hobbes
PPT
Storytime updated ppt
PDF
nullcon 2011 - Buffer UnderRun Exploits
PDF
The engineer’s licensing guidance document ELGD 2007
DOC
B.j. mate i
PDF
aclogを支えるデザイン
PPT
Earth moon statistics
PDF
Good prescribing
Streaming Replication Made Easy in v9.3
Tuning your PostgreSQL Database
1200 j lipman
Caldwell recognition-2012
Bab 5 9d
P1 L2
Jill lintner's portfolio
Hugps138
Horizons Beyond Dreams Business Plan
Intergenerational Networking
The Praying Indians of Megunko
Cultural strength
Las leyes naturales, según Thomas Hobbes
Storytime updated ppt
nullcon 2011 - Buffer UnderRun Exploits
The engineer’s licensing guidance document ELGD 2007
B.j. mate i
aclogを支えるデザイン
Earth moon statistics
Good prescribing
Ad

Similar to PostgreSQL v9.4features (20)

PDF
Introduction to MongoDB
PDF
Using MongoDB and Python
PDF
2016 feb-23 pyugre-py_mongo
PDF
What’s New in MariaDB Server 10.2
PPTX
Einführung in MongoDB
PDF
10 Reasons to Start Your Analytics Project with PostgreSQL
PDF
Json in Postgres - the Roadmap
 
PDF
Hibernate 6.0 - What's new.pdf
PPTX
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
PPTX
MongoDB Knowledge share
PDF
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
PDF
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
PDF
Scala and Spring
PDF
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
PPTX
Orcale dba training
PPTX
Oracle DBA Training in Hyderabad
PPTX
Oracle DBA Training in Hyderabad
PDF
Oracle adapters for Ruby ORMs
PDF
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
PDF
Local data storage for mobile apps
Introduction to MongoDB
Using MongoDB and Python
2016 feb-23 pyugre-py_mongo
What’s New in MariaDB Server 10.2
Einführung in MongoDB
10 Reasons to Start Your Analytics Project with PostgreSQL
Json in Postgres - the Roadmap
 
Hibernate 6.0 - What's new.pdf
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
MongoDB Knowledge share
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
Scala and Spring
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Orcale dba training
Oracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
Oracle adapters for Ruby ORMs
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Local data storage for mobile apps

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Encapsulation_ Review paper, used for researhc scholars

PostgreSQL v9.4features

  • 2. •JSONB-jsonBinary Storage •Replication improvements-Replication Slots •Logical Decoding in WAL log •Time Lagging Replica •pg_prewarm •ALTER SYSTEM Command •Great new enhancements in aggregation features
  • 3. Wasn’t JSON was introduced in v9.2? Well it just got better JSONB is much more optimized and faster for lookup New functions to extract and manipulate the jsondata You have the flexibility without compromising on Reliability! Non-relational data with ACID compliance!
  • 4. row_to_json–to convert a row to json json_object–Create jsonobject out of text array json_build_object–Create jsonobject out of variadicargument list array_to_json–to converan array to JSON json_eachand json_each_text–convert jsonobjects in key-value pair json_extract_path-Get value of a jsonobject json_populate_recordand json_populate_recordset-Convert jsonobject to records
  • 5. Operator Operand Type Purpose -> int Get JSON arraryelement -> text Get JSON object field ->> int Get JSON array element as text ->> text Get JSON object fieldas text #> array of text Get JSONobject at specified path #>> array of text Get JSON object at specified path as text @> jsonb Does the left JSON value contain within it the right value? <@ jsonb Is the left JSON value contained within the right value? ? text Does the key/elementstringexist within the JSON value? ?| text[] Do any of these key/elementstringsexist? ?& text[] Do all of these key/elementstringsexist?
  • 7. select data from Table as a jsonobject- SELECT JSON_BUILD_OBJECT( 'name',name) FROM books; Convert a row to json SELECT ROW_TO_JSON(my_row) FROM ( SELECT ROW(books.*) FROM books )my_row;
  • 8. Select output of join as a jsonobject- SELECT JSON_BUILD_OBJECT( 'name', name, 'author', name_arr) FROM( SELECT ARRAY_AGG( a.name ) AS name_arr, b.name AS name FROM authors a JOIN author_book_mapab ON a.id=ab.author_id JOIN books b ON b.id=ab.book_id GROUP BY b.name ) books_authors_join;
  • 9. Now you need to guess “wal_keep_segment” to avoid walfiles from getting removed Simply create a replication slot and WAL which are yet not replicated to the slot will not be removed from live WAL location Time Lagging Replica-You can define a lag period for your replica This can be used for back-dated reporting Or recover from a user error –an accidentally dropped table or a truncated table
  • 10. Set WAL level to ‘logical’ to do more verbose recoding in WAL files This will also record table and relation level details in each WAL entry These WAL files can be used for logical decoding and logical replication to replicate changes on a particular table There are commercial and open source solutions which are in beta stage and are based on this approach
  • 11. ALTER SYSTEM Command-Now a DBA can alter the configuration with ALTER SYSTEM command and avoid changing it in postgresql.conf pg_prewarm-now a DBA can load certain relations and blocks in cache after startup and avoid performance issues due to cold-reboot
  • 12. https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4 Hangout Recording for Replication Features in v9.4- https://www.youtube.com/watch?v=-HkrXwaWCb8 EnterpriseDB Whitepaper-http://www.enterprisedb.com/nosql-for-enterprise http://www.craigkerstiens.com/2014/03/24/Postgres-9.4-Looking-up/ Or just mail me… sameer.kasi200x@gmail.com sameer.kumar@ashnik.com