SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Redis: REmote DIctionary Server
Redis: REmote DIctionary ServerRedis: REmote DIctionary Server
Redis: REmote DIctionary Server
Ezra Zygmuntowicz
 
ETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk LoadingETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk Loading
alex_araujo
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deployment
hyeongchae lee
 

Was ist angesagt? (20)

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

Andere mochten auch

Caldwell recognition-2012
Caldwell recognition-2012Caldwell recognition-2012
Caldwell recognition-2012
ryanatsofa
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
ocwebservices
 
Storytime updated ppt
Storytime updated pptStorytime updated ppt
Storytime updated ppt
nolenlib
 

Andere mochten auch (20)

Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3
 
Tuning your PostgreSQL Database
Tuning your PostgreSQL DatabaseTuning your PostgreSQL Database
Tuning your PostgreSQL Database
 
1200 j lipman
1200 j lipman1200 j lipman
1200 j lipman
 
Caldwell recognition-2012
Caldwell recognition-2012Caldwell recognition-2012
Caldwell recognition-2012
 
Bab 5 9d
Bab 5 9dBab 5 9d
Bab 5 9d
 
P1 L2
P1 L2P1 L2
P1 L2
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
 
Hugps138
Hugps138Hugps138
Hugps138
 
Horizons Beyond Dreams Business Plan
Horizons Beyond Dreams Business PlanHorizons Beyond Dreams Business Plan
Horizons Beyond Dreams Business Plan
 
Intergenerational Networking
Intergenerational NetworkingIntergenerational Networking
Intergenerational Networking
 
The Praying Indians of Megunko
The Praying Indians of MegunkoThe Praying Indians of Megunko
The Praying Indians of Megunko
 
Cultural strength
Cultural strengthCultural strength
Cultural strength
 
Las leyes naturales, según Thomas Hobbes
Las leyes naturales, según Thomas HobbesLas leyes naturales, según Thomas Hobbes
Las leyes naturales, según Thomas Hobbes
 
Storytime updated ppt
Storytime updated pptStorytime updated ppt
Storytime updated ppt
 
nullcon 2011 - Buffer UnderRun Exploits
nullcon 2011 - Buffer UnderRun Exploitsnullcon 2011 - Buffer UnderRun Exploits
nullcon 2011 - Buffer UnderRun Exploits
 
The engineer’s licensing guidance document ELGD 2007
The engineer’s licensing guidance document ELGD 2007The engineer’s licensing guidance document ELGD 2007
The engineer’s licensing guidance document ELGD 2007
 
B.j. mate i
B.j. mate iB.j. mate i
B.j. mate i
 
aclogを支えるデザイン
aclogを支えるデザインaclogを支えるデザイン
aclogを支えるデザイン
 
Earth moon statistics
Earth moon statisticsEarth moon statistics
Earth moon statistics
 
Good prescribing
Good prescribingGood prescribing
Good prescribing
 

Ähnlich wie PostgreSQL v9.4features

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
Ugs8008
 

Ähnlich wie PostgreSQL v9.4features (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
What’s New in MariaDB Server 10.2
What’s New in MariaDB Server 10.2What’s New in MariaDB Server 10.2
What’s New in MariaDB Server 10.2
 
Einführung in MongoDB
Einführung in MongoDBEinführung in MongoDB
Einführung in MongoDB
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
Json in Postgres - the Roadmap
 Json in Postgres - the Roadmap Json in Postgres - the Roadmap
Json in Postgres - the Roadmap
 
Hibernate 6.0 - What's new.pdf
Hibernate 6.0 - What's new.pdfHibernate 6.0 - What's new.pdf
Hibernate 6.0 - What's new.pdf
 
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
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...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...
 
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...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...
 
(DEV309) Large-Scale Metrics Analysis in Ruby
(DEV309) Large-Scale Metrics Analysis in Ruby(DEV309) Large-Scale Metrics Analysis in Ruby
(DEV309) Large-Scale Metrics Analysis in Ruby
 
Scala and Spring
Scala and SpringScala and Spring
Scala and Spring
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle adapters for Ruby ORMs
Oracle adapters for Ruby ORMsOracle adapters for Ruby ORMs
Oracle adapters for Ruby ORMs
 
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DBPower Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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