SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Presenter: Mubashar Iqbal
Senior Software Engineer
Object Relational Database System
Judging Criteria ??
Fast
Flexible
Powerful
Scalable
Easy Deployment
What’s in your mind ?
Introduction
The world's most advanced open source object-relational database system. The open
source Oracle. PostgreSQL has a large distributed developer and user community.
Community-owned with many companies involved.
Supported operating systems
● Linux
● Unix
● Mac OS X
● Solaris
● Windows
Native programming interfaces for:
C/C++, Java, .Net, Perl, Python, Ruby, PHP
Development Priorities
● Designed by/for Database Administrators
● Data integrity
● Security
● Reliability
● Standards
● DB Features
● Performance
● Ease-of-use
● Programmer Features
Most Common Uses
● ERP
● Data Warehouse
● Geographic
● OEM applications
● Network tools
● CRM
Prominent users
● Yahoo! for web user behavioral analysis, storing two petabytes and claimed to be
the largest data warehouse using a heavily modified version of PostgreSQL
● Sony Online multiplayer online games.
● Reddit social news website.
● Skype VoIP application, central business databases.
● Sun xVM, Sun's virtualization and datacenter automation suite.
● MusicBrainz, open online music encyclopedia.
● MyYearbook social networking site.
● Instagram, a popular mobile photo sharing service
● Disqus, an online discussion and commenting service
Features
● PostgreSQL often described as an open-source version of Oracle.
● BSD/MIT type license
● Reliability is PostgreSQL's top priority.
● Well-engineered, capable of supporting high-transaction and mission-critical
applications.
● Comprehensive documentation and manuals available for free online.
● Commercial support is available from independent vendors.
● PostgreSQL is fully ACID compliant.
● PostgreSQL is considered the solemn, full-featured, workhorse for transactional
enterprise applications, with strong ACID compliance.
Features (contd..)
● PostgreSQL supports one storage engine.
● SSL encryption
● Online backup
● Point-in-time recovery: Restore to any time in the past.
● Regular expression
Tools
● Psql: Command line front-end
● pgAdmin: GUI front-end
● phpPgadmin: Web based front-end
● MS ODBC
● MS Office + Postgres
● NaviCat: $$
● DeZign: $$
● EMS SQL Manager for PostgreSQL: $$
Data Types
● Numeric Types
● Character Types
● Hierarchical Types
● Binary Data Types
● Geometric Types
● Network Address Types
● Text Search Types
● UUID Type
● XML Type
● JSON Type
● Arrays
● Composite Types
Indexes
B-tree: B-trees can handle equality and range queries on data that can be sorted into
some ordering (<, <=,=,>=,>)
Hash: Hash indexes can only handle simple equality comparisons
GIN: GIN indexes are inverted indexes which can handle values that contain more than
one key, arrays for example, GIN operator classes for one-dimensional arrays
(<@,@>,=,&&)
GiST: Generalized Search Tree, it is a tree-structured access method and also known as
two-dimensional geometric data types (<@,@>,=,&&,>>,<<,&<,>&,~=)
Functions
A stored procedure and user-defined function is a set of SQL and procedural statements
(declarations, assignments, loops, flow-of-control) that stored on the database server and
can be invoked using the SQL interface.
CREATE FUNCTION function_name(p1 type, p2 type)
RETURNS type AS
BEGIN
-- logic
END;
LANGUAGE language_name;
Triggers
On DML (Data Manipulation Language) SELECT, INSERT, UPDATE, DELETE
CREATE TRIGGER
name { BEFORE | AFTER } { event [ OR ... ] }
ON
table [ FOR [ EACH ] { ROW | STATEMENT } ]
EXECUTE PROCEDURE
funcname ( arguments )
Cursors
● Used instead of FOR.
● Avoid memory overrun.
● Large data set.
DECLARE curs1 refcursor;
curs2 CURSOR FOR SELECT * FROM tenk1;
OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey;
FETCH curs2 INTO foo, bar, baz;
CLOSE curs1;
View
View consists of a stored query accessible as a virtual table in a relational database or a
set of documents in a document-oriented database composed of the result set of a query.
Views are a great way to simplify your data model.
CREATE VIEW table_information AS
SELECT * FROM table WHERE id = 123;
Now you can simply query your new table directly:
SELECT * FROM table_information;
User-defined objects
New types of almost all objects inside the database can be created, including:
● Casts
● Conversions
● Data types
● Domains
● Functions, including aggregate functions and window functions
● Indexes including custom indexes for custom types
● Operators (existing ones can be overloaded)
● Procedural languages
Replication Methods
1. Master/Slave
● Asynchronous
● Synchronous
2. Multi-Master
● Asynchronous
● Synchronous
3. Proxy
4. Standby system
Master/Slave Replication
Asynchronous Synchronous
High availability High availibility
Read performance Better read performance
Offline peers Worse write performance
async
M S M S
sync
Multi-Master Replication
Asynchronous Synchronous
Read performance High availiability
Faster access across WANs Read performance
Manage offline peers Difficult to get good write performance
M M M M
async sync
Scaling behaviour
Comparison of scaling behaviour
Hierarchical Database
Data is organized into a tree like structure.
Representing information using parent/child relationships.
Each parent can have many children, but each child has only one parent also known as a 1-
to-many relationship.
Different ways store data like this are
• Enumeration path (ltree)
• Adjacency List
• Nested Sets
LTree – Label Tree
● Ltree is a PostgreSQL module.
● It is implements a data type ltree for representing labels of data stored in a
hierarchical tree-like structure.
● Labels must be less than 256 bytes long. ltree stores a label path.
● A label path is a sequence of zero or more labels separated by dots.
● ltree supports several types of indexes that can speed up the indicated operators.
● Ltree performance is much better when you need to do ad-hoc queries over the tree
● Faster than recursive function that constantly needs to recalculate the branching.
● Some other databases have similar types. SQL Server 2008 has a datatype called
HierarchyID which serves the same purpose as ltree but with different syntax.
Example
Technique Adjacency Ltree
Query WITH RECURSIVE d AS (
SELECT id
FROM sponsorship WHERE id = 799
UNION ALL
SELECT s.id
FROM d JOIN sponsorship s ON
s.parent_fk = d.id
)
SELECT * FROM d ORDER BY id
LIMIT 100;
WITH p AS (
SELECT path FROM
sponsorship
WHERE id=799
)
SELECT s.id
FROM sponsorship s, p
WHERE s.path <@ p.path
ORDER BY s.id LIMIT 100;
Total Runtime 1946.48 ms 28.00 ms
More Details
1. Value Expression
http://www.postgresql.org/docs/9.2/static/sql-expressions.html
2. String Functions and Operators
http://www.postgresql.org/docs/9.2/static/functions-string.html
3. Mathematical Functions and Operators
http://www.postgresql.org/docs/9.2/static/functions-math.html
4. MySQL vs PostgreSQL
http://get.enterprisedb.com/whitepapers/Postgres_Plus_8.4_vs_MySQL_5.5.pdf
5. Scaling Behaviour
http://tweakers.net/reviews/657/1/database-test-dual-intel-xeon-5160-introduction.html
References
http://www.postgresql.org/
http://tweakers.net/reviews/657/5/database-test-dual-intel-xeon-5160-
comparison-of-scaling-behaviour.html
http://www.slideshare.net/petereisentraut/replication-solutions-for-postgresql
http://gbif.blogspot.com/2012/06/taxonomic-trees-in-postgresql.html
http://www.slideshare.net/vuhung16plus/postgre-sqlintroduction20100506
PostgreSQL - Object Relational Database

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

MongoDB
MongoDBMongoDB
MongoDB
 
Non Relational Databases
Non Relational DatabasesNon Relational Databases
Non Relational Databases
 
NoSQL Introduction
NoSQL IntroductionNoSQL Introduction
NoSQL Introduction
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
NoSQL and MapReduce
NoSQL and MapReduceNoSQL and MapReduce
NoSQL and MapReduce
 
An Intro to NoSQL Databases
An Intro to NoSQL DatabasesAn Intro to NoSQL Databases
An Intro to NoSQL Databases
 
Java full stack1
Java full stack1Java full stack1
Java full stack1
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
MongoDB
MongoDBMongoDB
MongoDB
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
An introduction to Nosql
An introduction to NosqlAn introduction to Nosql
An introduction to Nosql
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
NoSQL-Database-Concepts
NoSQL-Database-ConceptsNoSQL-Database-Concepts
NoSQL-Database-Concepts
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 

Andere mochten auch

The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoBeat Signer
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management SystemAmar Myana
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQLVu Hung Nguyen
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management SystemAjay Jha
 
Cloud Architecture best practices
Cloud Architecture best practicesCloud Architecture best practices
Cloud Architecture best practicesOmid Vahdaty
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Sahan Walpitagamage
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014EDB
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbmsmaryeem
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMSkoolkampus
 

Andere mochten auch (12)

The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management System
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQL
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
 
Cloud Architecture best practices
Cloud Architecture best practicesCloud Architecture best practices
Cloud Architecture best practices
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
 
Types dbms
Types dbmsTypes dbms
Types dbms
 
Practical Object Oriented Models In Sql
Practical Object Oriented Models In SqlPractical Object Oriented Models In Sql
Practical Object Oriented Models In Sql
 

Ähnlich wie PostgreSQL - Object Relational Database

Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017HashedIn Technologies
 
Apache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-AriApache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-AriDemi Ben-Ari
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersMichael Rys
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3RojaT4
 
Apache Hive for modern DBAs
Apache Hive for modern DBAsApache Hive for modern DBAs
Apache Hive for modern DBAsLuis Marques
 
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...Alexey Zinoviev
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLAlexei Krasner
 
PASS Summit - SQL Server 2017 Deep Dive
PASS Summit - SQL Server 2017 Deep DivePASS Summit - SQL Server 2017 Deep Dive
PASS Summit - SQL Server 2017 Deep DiveTravis Wright
 
MOOC_PRESENTATION_FINAL_PART_1[1].pptx
MOOC_PRESENTATION_FINAL_PART_1[1].pptxMOOC_PRESENTATION_FINAL_PART_1[1].pptx
MOOC_PRESENTATION_FINAL_PART_1[1].pptxmh3473
 
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...Command Prompt., Inc
 
No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresqlZaid Shabbir
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...javier ramirez
 
WhereHows: Taming Metadata for 150K Datasets Over 9 Data Platforms
WhereHows: Taming Metadata for 150K Datasets Over 9 Data PlatformsWhereHows: Taming Metadata for 150K Datasets Over 9 Data Platforms
WhereHows: Taming Metadata for 150K Datasets Over 9 Data PlatformsMars Lan
 
Introduction to Postrges-XC
Introduction to Postrges-XCIntroduction to Postrges-XC
Introduction to Postrges-XCAshutosh Bapat
 
Build an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsBuild an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsShawn Zhu
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartMukesh Singh
 

Ähnlich wie PostgreSQL - Object Relational Database (20)

NoSQL
NoSQLNoSQL
NoSQL
 
Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017Redis Modules - Redis India Tour - 2017
Redis Modules - Redis India Tour - 2017
 
An Introduction to Postgresql
An Introduction to PostgresqlAn Introduction to Postgresql
An Introduction to Postgresql
 
Apache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-AriApache Spark 101 - Demi Ben-Ari
Apache Spark 101 - Demi Ben-Ari
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for Developers
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
 
Apache Hive for modern DBAs
Apache Hive for modern DBAsApache Hive for modern DBAs
Apache Hive for modern DBAs
 
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
JPoint'15 Mom, I so wish Hibernate for my NoSQL database...
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
 
PASS Summit - SQL Server 2017 Deep Dive
PASS Summit - SQL Server 2017 Deep DivePASS Summit - SQL Server 2017 Deep Dive
PASS Summit - SQL Server 2017 Deep Dive
 
MOOC_PRESENTATION_FINAL_PART_1[1].pptx
MOOC_PRESENTATION_FINAL_PART_1[1].pptxMOOC_PRESENTATION_FINAL_PART_1[1].pptx
MOOC_PRESENTATION_FINAL_PART_1[1].pptx
 
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
 
Cassandra training
Cassandra trainingCassandra training
Cassandra training
 
No sql bigdata and postgresql
No sql bigdata and postgresqlNo sql bigdata and postgresql
No sql bigdata and postgresql
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
 
WhereHows: Taming Metadata for 150K Datasets Over 9 Data Platforms
WhereHows: Taming Metadata for 150K Datasets Over 9 Data PlatformsWhereHows: Taming Metadata for 150K Datasets Over 9 Data Platforms
WhereHows: Taming Metadata for 150K Datasets Over 9 Data Platforms
 
Introduction to Postrges-XC
Introduction to Postrges-XCIntroduction to Postrges-XC
Introduction to Postrges-XC
 
Introducing Datawave
Introducing DatawaveIntroducing Datawave
Introducing Datawave
 
Build an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsBuild an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data Scientists
 
Ledingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @LendingkartLedingkart Meetup #2: Scaling Search @Lendingkart
Ledingkart Meetup #2: Scaling Search @Lendingkart
 

Kürzlich hochgeladen

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Kürzlich hochgeladen (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

PostgreSQL - Object Relational Database

  • 1.
  • 2. Presenter: Mubashar Iqbal Senior Software Engineer Object Relational Database System
  • 10.
  • 11. Introduction The world's most advanced open source object-relational database system. The open source Oracle. PostgreSQL has a large distributed developer and user community. Community-owned with many companies involved. Supported operating systems ● Linux ● Unix ● Mac OS X ● Solaris ● Windows Native programming interfaces for: C/C++, Java, .Net, Perl, Python, Ruby, PHP
  • 12. Development Priorities ● Designed by/for Database Administrators ● Data integrity ● Security ● Reliability ● Standards ● DB Features ● Performance ● Ease-of-use ● Programmer Features
  • 13. Most Common Uses ● ERP ● Data Warehouse ● Geographic ● OEM applications ● Network tools ● CRM
  • 14. Prominent users ● Yahoo! for web user behavioral analysis, storing two petabytes and claimed to be the largest data warehouse using a heavily modified version of PostgreSQL ● Sony Online multiplayer online games. ● Reddit social news website. ● Skype VoIP application, central business databases. ● Sun xVM, Sun's virtualization and datacenter automation suite. ● MusicBrainz, open online music encyclopedia. ● MyYearbook social networking site. ● Instagram, a popular mobile photo sharing service ● Disqus, an online discussion and commenting service
  • 15. Features ● PostgreSQL often described as an open-source version of Oracle. ● BSD/MIT type license ● Reliability is PostgreSQL's top priority. ● Well-engineered, capable of supporting high-transaction and mission-critical applications. ● Comprehensive documentation and manuals available for free online. ● Commercial support is available from independent vendors. ● PostgreSQL is fully ACID compliant. ● PostgreSQL is considered the solemn, full-featured, workhorse for transactional enterprise applications, with strong ACID compliance.
  • 16. Features (contd..) ● PostgreSQL supports one storage engine. ● SSL encryption ● Online backup ● Point-in-time recovery: Restore to any time in the past. ● Regular expression
  • 17. Tools ● Psql: Command line front-end ● pgAdmin: GUI front-end ● phpPgadmin: Web based front-end ● MS ODBC ● MS Office + Postgres ● NaviCat: $$ ● DeZign: $$ ● EMS SQL Manager for PostgreSQL: $$
  • 18. Data Types ● Numeric Types ● Character Types ● Hierarchical Types ● Binary Data Types ● Geometric Types ● Network Address Types ● Text Search Types ● UUID Type ● XML Type ● JSON Type ● Arrays ● Composite Types
  • 19. Indexes B-tree: B-trees can handle equality and range queries on data that can be sorted into some ordering (<, <=,=,>=,>) Hash: Hash indexes can only handle simple equality comparisons GIN: GIN indexes are inverted indexes which can handle values that contain more than one key, arrays for example, GIN operator classes for one-dimensional arrays (<@,@>,=,&&) GiST: Generalized Search Tree, it is a tree-structured access method and also known as two-dimensional geometric data types (<@,@>,=,&&,>>,<<,&<,>&,~=)
  • 20. Functions A stored procedure and user-defined function is a set of SQL and procedural statements (declarations, assignments, loops, flow-of-control) that stored on the database server and can be invoked using the SQL interface. CREATE FUNCTION function_name(p1 type, p2 type) RETURNS type AS BEGIN -- logic END; LANGUAGE language_name;
  • 21. Triggers On DML (Data Manipulation Language) SELECT, INSERT, UPDATE, DELETE CREATE TRIGGER name { BEFORE | AFTER } { event [ OR ... ] } ON table [ FOR [ EACH ] { ROW | STATEMENT } ] EXECUTE PROCEDURE funcname ( arguments )
  • 22. Cursors ● Used instead of FOR. ● Avoid memory overrun. ● Large data set. DECLARE curs1 refcursor; curs2 CURSOR FOR SELECT * FROM tenk1; OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey; FETCH curs2 INTO foo, bar, baz; CLOSE curs1;
  • 23. View View consists of a stored query accessible as a virtual table in a relational database or a set of documents in a document-oriented database composed of the result set of a query. Views are a great way to simplify your data model. CREATE VIEW table_information AS SELECT * FROM table WHERE id = 123; Now you can simply query your new table directly: SELECT * FROM table_information;
  • 24. User-defined objects New types of almost all objects inside the database can be created, including: ● Casts ● Conversions ● Data types ● Domains ● Functions, including aggregate functions and window functions ● Indexes including custom indexes for custom types ● Operators (existing ones can be overloaded) ● Procedural languages
  • 25. Replication Methods 1. Master/Slave ● Asynchronous ● Synchronous 2. Multi-Master ● Asynchronous ● Synchronous 3. Proxy 4. Standby system
  • 26. Master/Slave Replication Asynchronous Synchronous High availability High availibility Read performance Better read performance Offline peers Worse write performance async M S M S sync
  • 27. Multi-Master Replication Asynchronous Synchronous Read performance High availiability Faster access across WANs Read performance Manage offline peers Difficult to get good write performance M M M M async sync
  • 30. Hierarchical Database Data is organized into a tree like structure. Representing information using parent/child relationships. Each parent can have many children, but each child has only one parent also known as a 1- to-many relationship. Different ways store data like this are • Enumeration path (ltree) • Adjacency List • Nested Sets
  • 31. LTree – Label Tree ● Ltree is a PostgreSQL module. ● It is implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. ● Labels must be less than 256 bytes long. ltree stores a label path. ● A label path is a sequence of zero or more labels separated by dots. ● ltree supports several types of indexes that can speed up the indicated operators. ● Ltree performance is much better when you need to do ad-hoc queries over the tree ● Faster than recursive function that constantly needs to recalculate the branching. ● Some other databases have similar types. SQL Server 2008 has a datatype called HierarchyID which serves the same purpose as ltree but with different syntax.
  • 32. Example Technique Adjacency Ltree Query WITH RECURSIVE d AS ( SELECT id FROM sponsorship WHERE id = 799 UNION ALL SELECT s.id FROM d JOIN sponsorship s ON s.parent_fk = d.id ) SELECT * FROM d ORDER BY id LIMIT 100; WITH p AS ( SELECT path FROM sponsorship WHERE id=799 ) SELECT s.id FROM sponsorship s, p WHERE s.path <@ p.path ORDER BY s.id LIMIT 100; Total Runtime 1946.48 ms 28.00 ms
  • 33. More Details 1. Value Expression http://www.postgresql.org/docs/9.2/static/sql-expressions.html 2. String Functions and Operators http://www.postgresql.org/docs/9.2/static/functions-string.html 3. Mathematical Functions and Operators http://www.postgresql.org/docs/9.2/static/functions-math.html 4. MySQL vs PostgreSQL http://get.enterprisedb.com/whitepapers/Postgres_Plus_8.4_vs_MySQL_5.5.pdf 5. Scaling Behaviour http://tweakers.net/reviews/657/1/database-test-dual-intel-xeon-5160-introduction.html