SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
PostgreSQL and the future
Aaron Thul
Who am I?
•  Computer & Database Geek
•  Formerly a Debian SysAdmin
•  Presently Vice President of Technology at a
   EMOL
•  PostgreSQL Evangelist
•  Penguicon Organizer
Ground rules
•  Questions are good
•  Arguments are bad
Agenda
•  Big News
•  New Features
•  State of PostgreSQL Community
•  Evil
•  Profit
First Things First

•  There is some big news
First Things First

•  There is some big news
•  PostgreSQL 8.5 is…
First Things First

•  There is some big news
•  PostgreSQL 8.5 is…


• PostgreSQL 9.0 !
Why 8.5 became 9.0

•  Built-in log-streaming replication
•  Hot standby
New Features
Streaming replication

•  Warm Standby 8.x to Hot Standby
•  New kinds of postmaster processes, walsenders
   and walreceiver
•  Thanks to Streaming Replication, lag should be
   nearly zero
DROP IF EXISTS
•  Columns
•  Constraints
Better messages for unique violation
•  Improve unique-constraint-violation error
   messages to include the exact values being
   complained of.
Deferrable Uniqueness
•  Massive unique-key reassignments
MOVE FORWARD or BACKWARD
•  MOVE {FORWARD,BACKWARD} X
•  More easily move around in a curser
’samehost’ and ’samenet’
•  Does anyone know what HBA stands for?
•  To lazy to list all the hosts on your network
•  CIDR-ADDRESS
GRANT ALL
•  Grant privileges on all existing tables
•  Automatically grant privileges on all tables that
   will be created in this database in the future
TRIGGERS on columns
•  SQL-compliant triggers on columns, ie fire only
   if certain columns are named in the UPDATE's
   SET list
•  Help resolve circular TRIGGER issues
Conditional TRIGGERS
CREATE TRIGGER test_u
 AFTER UPDATE ON test
 FOR EACH ROW
 WHEN ( NEW.i <= 0 )
 EXECUTE PROCEDURE test_u();
VACUUM FULL
•  VACUUM FULL will start to behave like
   CLUSTER
•  Will not actually be reordering rows
•  VACUUM FULL INPLACE
Buffers info for explain
explain ( analyze on, buffers on ) select count(*)
  from pg_attribute ;

  QUERY PLAN
----------------------------------------------------
  ----------------------

 Aggregate (cost=64.70..64.71 rows=1 width=0)
  (actual time=0.466..0.466 rows=1 loops=1)
   Buffers: shared hit=18 read=21
   -> Seq Scan on pg_attribute (cost=0.00..59.56
  rows=2056 width=0) (actual time=0.002..0.301
  rows=2002 loops=1)
         Buffers: shared hit=18 read=21
 Total runtime: 0.492 ms
The list goes on
•  Multi-threaded pgbench
•  Hinting for number of distinct values
•  Machine readable EXPLAIN
•  Checking password strength
•  PL/pgSQL by default
PostgreSQL Community
Who makes database Software
•  Oracle/SUN
•  IBM
•  Microsoft
PostgreSQL Community
•  Community not company
•  Growing
•  International
•  PostgreSQL Association
•  Nothing happening with SUN/MySQL/Oracle is
   hurting the PostgreSQL community
www.postgresql.org
•  downloads
•  documentation
•  bug reports
•  security alerts
•  wiki
•  support companies
www.pgfoundry.org
•  Modules
•  Programs
•  Resources
www.planetpostgresql.org
•  Project News
•  Community News
•  Helpful Tips / Examples
archives.postgresql.org
•  mailing list archives back to 1997
•  full text search via postgtresql 8.3
•  keyword search suggestions
#postgresql
•  irc.freenode.net
•  real time help
•  rtfm_please - ??help
PostgreSQL Community Events
•  PGCon
•  PostgreSQL Conference 2009 Japan
•  European PGDay
•  PgWest
•  PgEast
•  PGCon Brazil
•  Local PUGs
•  http://wiki.postgresql.org/wiki/Events
Project Management
•  Core team
•  Committers
•  -hackers
•  Roadmap
•  Web team
Threats to PostgreSQL
•  Patent attacks
•  Hiring of volunteers to work on unrelated
   projects
Evil
Data Types
•  Just use text
  ▫  char/varchar/text the same under the hood
  ▫  avoid artificial limits
•  Focus on functions
  ▫  Phone numbers often require string manipulation
  ▫  Unix timestamp vs. Date arithmetic
•  Minimize typecasts
Take advantage of strong data typing
•  CHECK limits input at column level
•  ENUM limits specific values at type level
 ▫  Allows you to define a custom order, provides
    compact storage
•  DOMAIN defines a data type within constraint
   boundaries
•  Often outperforms JOIN on lookup tables
•  Allows for simpler schema design
Normalization (3NF)
•  All non-key columns must be directly dependent on PK
   ▫  Head is only dependent on the Name through the
      Workgroup column
Surrogate Keys
•  Natural Key (NK) is a CK with a natural
   relationship to that row
•  Surrogate Key (SK) is an artificially added
   unique identifier
 ▫  Since they are artificial they make queries harder
    to readand can lead to more joins
•  Integers do not significantly improve JOIN
   performance or reduce file I/O for many data
   sets
Bareword ids
•  Makes SQL less obvious to read
 ▫  SELECT id, id, id FROM foo, bar, baz WHERE …
 ▫  Makes ANSI JOIN syntax more cumbersome
    JOIN foo USING (bar_id)
 ▫  JOIN foo ON (foo.bar_id = bar.id)
•  Often resort to alias columns to add clarity,
   scoping
•  Some ORMs really like this (can be overridden
•  Use verbose id names instead
 ▫  Create table actor (actor_id, full_name text);
Use standard definitions
•  Often data has been designed in a standard way
 ▫  Country Code
 ▫  Email address
 ▫  Zip Code
 ▫  VIN
 ▫  SEX (ISO 5218)
•  Helps eliminate short-sightedness
•  Increases commonality across projects
Images in the database
•  Replication
•  Backups
•  Access control
•  Transactions
•  OS Portability
Over indexing
•  Indexes must be updated when data changes
   occur
 ▫  INSERT/UPDATE/DELETE all touch indexes
 ▫  Some like it HOT, pg_stat_all_tables
•  BitMap vs. Multi-Column Indexes
 ▫  Combine index on (a) and (b) in memory
 ▫  Index on (x,y,z) implies index on (x) and (x,y)
•  Make sure indexes are used
 ▫  pg_stat_all_indexes
Covering indexes
•  Creating indexes to avoid accessing data in the
   table
 ▫  TOAST makes this less necessary
 ▫  Visibility information stored in the table
Full text indexing
•  IT ROCKS!
•  Add search engine style functionality to DBMS
 ▫  LIKE '%foo%' and LIKE '%foo' cannot use index
 ▫  Regex searching has similar issues
 ▫  Built-in tsearch functionality in 8.3+
     GIN, expensive to update, very fast for searching
     GIST, cheaper to update, not as fast for searching
•  Database Specific Syntax
Profit
Lessons To Take Away
•  PostgreSQL 9.0 is going to rock
•  Never confuse a company with community
•  Some mistakes are just to much fun to make
   only once
•  Never ask for directions from a two-headed
   tourist!
   -Big Bird
Thanks to
•  The PostgreSQL Community!
•  Robert Treat
•  Hubert Lubaczewski
•  More info:
 ▫  http://www.depesz.com/
 ▫  http://www.xzilla.net/
Questions
•  Web: http://www.chasingnuts.com
•  Email: aaron@chasingnuts.com
•  IRC: AaronThul on irc.freenode.org
•  Jabber: apthul@gmail.com
•  Twitter: @AaronThul
•  AIM: AaronThul

Weitere ähnliche Inhalte

Was ist angesagt?

Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...
Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...
Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...DataStax Academy
 
Deep Dive into Cassandra
Deep Dive into CassandraDeep Dive into Cassandra
Deep Dive into CassandraBrent Theisen
 
SQL for Elasticsearch
SQL for ElasticsearchSQL for Elasticsearch
SQL for ElasticsearchJodok Batlogg
 
Call me maybe: Jepsen and flaky networks
Call me maybe: Jepsen and flaky networksCall me maybe: Jepsen and flaky networks
Call me maybe: Jepsen and flaky networksShalin Shekhar Mangar
 
PostgreSQL and Sphinx pgcon 2013
PostgreSQL and Sphinx   pgcon 2013PostgreSQL and Sphinx   pgcon 2013
PostgreSQL and Sphinx pgcon 2013Emanuel Calvo
 
Simple Works Best
 Simple Works Best Simple Works Best
Simple Works BestEDB
 
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Ontico
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparisonshsedghi
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msJodok Batlogg
 
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 TaipeiSatoshi Nagayasu
 
SQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory OLTPSQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory OLTPTony Rogerson
 
Data analysis scala_spark
Data analysis scala_sparkData analysis scala_spark
Data analysis scala_sparkYiguang Hu
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Matt Fuller
 
GNW01: In-Memory Processing for Databases
GNW01: In-Memory Processing for DatabasesGNW01: In-Memory Processing for Databases
GNW01: In-Memory Processing for DatabasesTanel Poder
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case Kai Sasaki
 
Don't change the partition count for kafka topics!
Don't change the partition count for kafka topics!Don't change the partition count for kafka topics!
Don't change the partition count for kafka topics!Dainius Jocas
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesJonathan Katz
 
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)Martin Traverso
 

Was ist angesagt? (20)

Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...
Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...
Cassandra Day SV 2014: Netflix’s Astyanax Java Client Driver for Apache Cassa...
 
Deep Dive into Cassandra
Deep Dive into CassandraDeep Dive into Cassandra
Deep Dive into Cassandra
 
SQL for Elasticsearch
SQL for ElasticsearchSQL for Elasticsearch
SQL for Elasticsearch
 
Call me maybe: Jepsen and flaky networks
Call me maybe: Jepsen and flaky networksCall me maybe: Jepsen and flaky networks
Call me maybe: Jepsen and flaky networks
 
Hbase Nosql
Hbase NosqlHbase Nosql
Hbase Nosql
 
PostgreSQL and Sphinx pgcon 2013
PostgreSQL and Sphinx   pgcon 2013PostgreSQL and Sphinx   pgcon 2013
PostgreSQL and Sphinx pgcon 2013
 
Simple Works Best
 Simple Works Best Simple Works Best
Simple Works Best
 
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
 
Cassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A ComparisonCassandra Java APIs Old and New – A Comparison
Cassandra Java APIs Old and New – A Comparison
 
You know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900msYou know, for search. Querying 24 Billion Documents in 900ms
You know, for search. Querying 24 Billion Documents in 900ms
 
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
 
SQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory OLTPSQL Server 2014 In-Memory OLTP
SQL Server 2014 In-Memory OLTP
 
Data analysis scala_spark
Data analysis scala_sparkData analysis scala_spark
Data analysis scala_spark
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
 
GNW01: In-Memory Processing for Databases
GNW01: In-Memory Processing for DatabasesGNW01: In-Memory Processing for Databases
GNW01: In-Memory Processing for Databases
 
Mentor Your Indexes
Mentor Your IndexesMentor Your Indexes
Mentor Your Indexes
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
 
Don't change the partition count for kafka topics!
Don't change the partition count for kafka topics!Don't change the partition count for kafka topics!
Don't change the partition count for kafka topics!
 
On Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data TypesOn Beyond (PostgreSQL) Data Types
On Beyond (PostgreSQL) Data Types
 
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
 

Andere mochten auch

Gill's Adventures
Gill's AdventuresGill's Adventures
Gill's Adventuresguest2ba819
 
Direct Instruction Power Point
Direct Instruction Power PointDirect Instruction Power Point
Direct Instruction Power Pointguestf917af
 
Profiles in Sucess
Profiles in Sucess Profiles in Sucess
Profiles in Sucess Lilly Harris
 
Drinkers guide to PostgreSQL
Drinkers guide to PostgreSQLDrinkers guide to PostgreSQL
Drinkers guide to PostgreSQLAaron Thul
 
a beautiful life- Calendar 2015
a beautiful life- Calendar 2015a beautiful life- Calendar 2015
a beautiful life- Calendar 2015rajeevkrs
 
Calendar 2014 Serenity
Calendar 2014 SerenityCalendar 2014 Serenity
Calendar 2014 Serenityrajeevkrs
 
Calendar 2016: On the road again
Calendar 2016: On the road againCalendar 2016: On the road again
Calendar 2016: On the road againrajeevkrs
 
Calendar 2014, Theme Cactus
Calendar 2014, Theme CactusCalendar 2014, Theme Cactus
Calendar 2014, Theme Cactusrajeevkrs
 
La Escuela Que Surge De La Revolucion 2o. Tetra
La Escuela Que Surge  De La Revolucion 2o. TetraLa Escuela Que Surge  De La Revolucion 2o. Tetra
La Escuela Que Surge De La Revolucion 2o. TetraEddras Coutiño Cruz
 
This is Your PostgreSQL on Drugs
This is Your PostgreSQL on DrugsThis is Your PostgreSQL on Drugs
This is Your PostgreSQL on DrugsAaron Thul
 
Direct Instruction Power Point
Direct Instruction Power PointDirect Instruction Power Point
Direct Instruction Power Pointguestf917af
 

Andere mochten auch (17)

Gill's Adventures
Gill's AdventuresGill's Adventures
Gill's Adventures
 
Direct Instruction Power Point
Direct Instruction Power PointDirect Instruction Power Point
Direct Instruction Power Point
 
Profiles in Sucess
Profiles in Sucess Profiles in Sucess
Profiles in Sucess
 
Presentación1
Presentación1Presentación1
Presentación1
 
Eagle
EagleEagle
Eagle
 
Pedagogia D La Imagen2
Pedagogia D La Imagen2Pedagogia D La Imagen2
Pedagogia D La Imagen2
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
Evaluacion De Planes Y Programas
Evaluacion De Planes Y ProgramasEvaluacion De Planes Y Programas
Evaluacion De Planes Y Programas
 
Drinkers guide to PostgreSQL
Drinkers guide to PostgreSQLDrinkers guide to PostgreSQL
Drinkers guide to PostgreSQL
 
a beautiful life- Calendar 2015
a beautiful life- Calendar 2015a beautiful life- Calendar 2015
a beautiful life- Calendar 2015
 
Calendar 2014 Serenity
Calendar 2014 SerenityCalendar 2014 Serenity
Calendar 2014 Serenity
 
Calendar 2016: On the road again
Calendar 2016: On the road againCalendar 2016: On the road again
Calendar 2016: On the road again
 
Calendar 2014, Theme Cactus
Calendar 2014, Theme CactusCalendar 2014, Theme Cactus
Calendar 2014, Theme Cactus
 
La Escuela Que Surge De La Revolucion 2o. Tetra
La Escuela Que Surge  De La Revolucion 2o. TetraLa Escuela Que Surge  De La Revolucion 2o. Tetra
La Escuela Que Surge De La Revolucion 2o. Tetra
 
This is Your PostgreSQL on Drugs
This is Your PostgreSQL on DrugsThis is Your PostgreSQL on Drugs
This is Your PostgreSQL on Drugs
 
Direct Instruction Power Point
Direct Instruction Power PointDirect Instruction Power Point
Direct Instruction Power Point
 
Emiliano Zapata
Emiliano ZapataEmiliano Zapata
Emiliano Zapata
 

Ähnlich wie PostgreSQL 9.0 & The Future

Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Yandex
 
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovPostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovNikolay Samokhvalov
 
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 PostgreSQLSatoshi Nagayasu
 
30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practicesDavid Dhavan
 
What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4Pavan Deolasee
 
Cassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series ModelingCassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series ModelingVassilis Bekiaris
 
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)Ontico
 
AWS June 2016 Webinar Series - Amazon Redshift or Big Data Analytics
AWS June 2016 Webinar Series - Amazon Redshift or Big Data AnalyticsAWS June 2016 Webinar Series - Amazon Redshift or Big Data Analytics
AWS June 2016 Webinar Series - Amazon Redshift or Big Data AnalyticsAmazon Web Services
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databaseBarry Jones
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevAltinity Ltd
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 Richie Rump
 
Best Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon RedshiftBest Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon RedshiftAmazon Web Services
 
In memory databases presentation
In memory databases presentationIn memory databases presentation
In memory databases presentationMichael Keane
 

Ähnlich wie PostgreSQL 9.0 & The Future (20)

PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
Cassandra training
Cassandra trainingCassandra training
Cassandra training
 
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
Типы данных JSONb, соответствующие индексы и модуль jsquery – Олег Бартунов, ...
 
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander KorotkovPostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
PostgreSQL Moscow Meetup - September 2014 - Oleg Bartunov and Alexander Korotkov
 
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
 
30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices30334823 my sql-cluster-performance-tuning-best-practices
30334823 my sql-cluster-performance-tuning-best-practices
 
What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4What's New In PostgreSQL 9.4
What's New In PostgreSQL 9.4
 
Cassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series ModelingCassandra Basics, Counters and Time Series Modeling
Cassandra Basics, Counters and Time Series Modeling
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
Работа с индексами - лучшие практики для MySQL 5.6, Петр Зайцев (Percona)
 
AWS June 2016 Webinar Series - Amazon Redshift or Big Data Analytics
AWS June 2016 Webinar Series - Amazon Redshift or Big Data AnalyticsAWS June 2016 Webinar Series - Amazon Redshift or Big Data Analytics
AWS June 2016 Webinar Series - Amazon Redshift or Big Data Analytics
 
L6.sp17.pptx
L6.sp17.pptxL6.sp17.pptx
L6.sp17.pptx
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
 
Tunning overview
Tunning overviewTunning overview
Tunning overview
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
Best Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon RedshiftBest Practices for Migrating Your Data Warehouse to Amazon Redshift
Best Practices for Migrating Your Data Warehouse to Amazon Redshift
 
In memory databases presentation
In memory databases presentationIn memory databases presentation
In memory databases presentation
 

Kürzlich hochgeladen

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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 WorkerThousandEyes
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

PostgreSQL 9.0 & The Future

  • 1. PostgreSQL and the future Aaron Thul
  • 2. Who am I? •  Computer & Database Geek •  Formerly a Debian SysAdmin •  Presently Vice President of Technology at a EMOL •  PostgreSQL Evangelist •  Penguicon Organizer
  • 3.
  • 4.
  • 5. Ground rules •  Questions are good •  Arguments are bad
  • 6. Agenda •  Big News •  New Features •  State of PostgreSQL Community •  Evil •  Profit
  • 7. First Things First •  There is some big news
  • 8. First Things First •  There is some big news •  PostgreSQL 8.5 is…
  • 9. First Things First •  There is some big news •  PostgreSQL 8.5 is… • PostgreSQL 9.0 !
  • 10. Why 8.5 became 9.0 •  Built-in log-streaming replication •  Hot standby
  • 12. Streaming replication •  Warm Standby 8.x to Hot Standby •  New kinds of postmaster processes, walsenders and walreceiver •  Thanks to Streaming Replication, lag should be nearly zero
  • 13. DROP IF EXISTS •  Columns •  Constraints
  • 14. Better messages for unique violation •  Improve unique-constraint-violation error messages to include the exact values being complained of.
  • 15. Deferrable Uniqueness •  Massive unique-key reassignments
  • 16. MOVE FORWARD or BACKWARD •  MOVE {FORWARD,BACKWARD} X •  More easily move around in a curser
  • 17. ’samehost’ and ’samenet’ •  Does anyone know what HBA stands for? •  To lazy to list all the hosts on your network •  CIDR-ADDRESS
  • 18. GRANT ALL •  Grant privileges on all existing tables •  Automatically grant privileges on all tables that will be created in this database in the future
  • 19. TRIGGERS on columns •  SQL-compliant triggers on columns, ie fire only if certain columns are named in the UPDATE's SET list •  Help resolve circular TRIGGER issues
  • 20. Conditional TRIGGERS CREATE TRIGGER test_u AFTER UPDATE ON test FOR EACH ROW WHEN ( NEW.i <= 0 ) EXECUTE PROCEDURE test_u();
  • 21. VACUUM FULL •  VACUUM FULL will start to behave like CLUSTER •  Will not actually be reordering rows •  VACUUM FULL INPLACE
  • 22. Buffers info for explain explain ( analyze on, buffers on ) select count(*) from pg_attribute ; QUERY PLAN ---------------------------------------------------- ---------------------- Aggregate (cost=64.70..64.71 rows=1 width=0) (actual time=0.466..0.466 rows=1 loops=1) Buffers: shared hit=18 read=21 -> Seq Scan on pg_attribute (cost=0.00..59.56 rows=2056 width=0) (actual time=0.002..0.301 rows=2002 loops=1) Buffers: shared hit=18 read=21 Total runtime: 0.492 ms
  • 23. The list goes on •  Multi-threaded pgbench •  Hinting for number of distinct values •  Machine readable EXPLAIN •  Checking password strength •  PL/pgSQL by default
  • 25. Who makes database Software •  Oracle/SUN •  IBM •  Microsoft
  • 26. PostgreSQL Community •  Community not company •  Growing •  International •  PostgreSQL Association •  Nothing happening with SUN/MySQL/Oracle is hurting the PostgreSQL community
  • 27. www.postgresql.org •  downloads •  documentation •  bug reports •  security alerts •  wiki •  support companies
  • 29. www.planetpostgresql.org •  Project News •  Community News •  Helpful Tips / Examples
  • 30. archives.postgresql.org •  mailing list archives back to 1997 •  full text search via postgtresql 8.3 •  keyword search suggestions
  • 31. #postgresql •  irc.freenode.net •  real time help •  rtfm_please - ??help
  • 32. PostgreSQL Community Events •  PGCon •  PostgreSQL Conference 2009 Japan •  European PGDay •  PgWest •  PgEast •  PGCon Brazil •  Local PUGs •  http://wiki.postgresql.org/wiki/Events
  • 33. Project Management •  Core team •  Committers •  -hackers •  Roadmap •  Web team
  • 34. Threats to PostgreSQL •  Patent attacks •  Hiring of volunteers to work on unrelated projects
  • 35. Evil
  • 36. Data Types •  Just use text ▫  char/varchar/text the same under the hood ▫  avoid artificial limits •  Focus on functions ▫  Phone numbers often require string manipulation ▫  Unix timestamp vs. Date arithmetic •  Minimize typecasts
  • 37. Take advantage of strong data typing •  CHECK limits input at column level •  ENUM limits specific values at type level ▫  Allows you to define a custom order, provides compact storage •  DOMAIN defines a data type within constraint boundaries •  Often outperforms JOIN on lookup tables •  Allows for simpler schema design
  • 38. Normalization (3NF) •  All non-key columns must be directly dependent on PK ▫  Head is only dependent on the Name through the Workgroup column
  • 39. Surrogate Keys •  Natural Key (NK) is a CK with a natural relationship to that row •  Surrogate Key (SK) is an artificially added unique identifier ▫  Since they are artificial they make queries harder to readand can lead to more joins •  Integers do not significantly improve JOIN performance or reduce file I/O for many data sets
  • 40. Bareword ids •  Makes SQL less obvious to read ▫  SELECT id, id, id FROM foo, bar, baz WHERE … ▫  Makes ANSI JOIN syntax more cumbersome JOIN foo USING (bar_id) ▫  JOIN foo ON (foo.bar_id = bar.id) •  Often resort to alias columns to add clarity, scoping •  Some ORMs really like this (can be overridden •  Use verbose id names instead ▫  Create table actor (actor_id, full_name text);
  • 41. Use standard definitions •  Often data has been designed in a standard way ▫  Country Code ▫  Email address ▫  Zip Code ▫  VIN ▫  SEX (ISO 5218) •  Helps eliminate short-sightedness •  Increases commonality across projects
  • 42. Images in the database •  Replication •  Backups •  Access control •  Transactions •  OS Portability
  • 43. Over indexing •  Indexes must be updated when data changes occur ▫  INSERT/UPDATE/DELETE all touch indexes ▫  Some like it HOT, pg_stat_all_tables •  BitMap vs. Multi-Column Indexes ▫  Combine index on (a) and (b) in memory ▫  Index on (x,y,z) implies index on (x) and (x,y) •  Make sure indexes are used ▫  pg_stat_all_indexes
  • 44. Covering indexes •  Creating indexes to avoid accessing data in the table ▫  TOAST makes this less necessary ▫  Visibility information stored in the table
  • 45. Full text indexing •  IT ROCKS! •  Add search engine style functionality to DBMS ▫  LIKE '%foo%' and LIKE '%foo' cannot use index ▫  Regex searching has similar issues ▫  Built-in tsearch functionality in 8.3+   GIN, expensive to update, very fast for searching   GIST, cheaper to update, not as fast for searching •  Database Specific Syntax
  • 47. Lessons To Take Away •  PostgreSQL 9.0 is going to rock •  Never confuse a company with community •  Some mistakes are just to much fun to make only once •  Never ask for directions from a two-headed tourist! -Big Bird
  • 48. Thanks to •  The PostgreSQL Community! •  Robert Treat •  Hubert Lubaczewski •  More info: ▫  http://www.depesz.com/ ▫  http://www.xzilla.net/
  • 49. Questions •  Web: http://www.chasingnuts.com •  Email: aaron@chasingnuts.com •  IRC: AaronThul on irc.freenode.org •  Jabber: apthul@gmail.com •  Twitter: @AaronThul •  AIM: AaronThul