SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Copyright © 2016 NTT DATA Corporation
03/17/2016
NTT DATA Corporation
Masahiko Sawada
Introduction to VACUUM, FREEZING and XID
wraparound
2Copyright © 2016NTT DATA Corporation
A little about me	
Ø  Masahiko Sawada
Ø  twitter : @sawada_masahiko
Ø  NTT DATA Corporation
Ø  Database engineer
Ø  PostgreSQL Hacker
Ø  Core feature
Ø  pg_bigm (PostgreSQL full text search module for multi-byte language)
3Copyright © 2016NTT DATA Corporation
Contents	
•  VACUUM
•  Visibility Map
•  Freezing Tuple
•  XID wraparound
•  New VACUUM feature for 9.6
Copyright © 2016 NTT DATA Corporation 4
What is the VACUUM?
5Copyright © 2016 NTT DATA Corporation
VACUUM	
1 AAA
2 BBB
3 CCC
2 bbb
4 DDD Concurrently INSERT/DELETE/UPDATE	
1 AAA
2 BBB
3 CCC
2 bbb
1 AAA
3 CCC
2 bbb
4 DDD
VACUUM
Starts
VACUUM
Done
FSM	
UPDATE : BBB->bbb	
•  Postgres garbage collection feature
•  Acquire ShareUpdateExclusive Lock
6Copyright © 2016 NTT DATA Corporation
Why do we need to VACUUM?	
•  Recover or reuse disk space occupied
•  Update data statistics
•  Update visibility map to speed up Index-Only Scan.
•  Protect against loss of very old data due to XID wraparound
7Copyright © 2016 NTT DATA Corporation
Evolution history of VACUUM	
v8.1 (2005) v8.4 (2009)
autovacuum
!?
Visibility Map
Free Space Map
v9.5 (2016)
vacuumdb
parallel option
v9.6
8Copyright © 2016 NTT DATA Corporation
VACUUM Syntax	
-- VACUUM whole database
=# VACUUM;
-- Multiple option, analyzing only col1 column
=# VACUUM FREEZE VERBOSE ANALYZE hoge (col1);
-- Multiple option with parentheses
=# VACUUM (FULL, ANALYZE, VERBOSE) hoge;
Copyright © 2016 NTT DATA Corporation 9
Visibility Map
10Copyright © 2016 NTT DATA Corporation
Visibility Map	
•  Introduced at 8.4
•  A bit map for each table (1 bit per 1 page)
•  A table relation can have a visibility map.
•  keep track of which pages are all-visible page
•  keep track of which pages are having garbage.
•  If 500GB table, Visibility Map is less than 10MB.
Table
(base/XXX/1234)	
Visibility Map
(base/XXX/1234_vm)	
Block 0
Block 1
Block 2
Block 3
Block 4	
11001…
11Copyright © 2016 NTT DATA Corporation
State transition of Visibility Map bit	
VACUUM
0 1
INSERT, UPDATE, DELETE
(NOT all-visible)	
 (all-visible)
12Copyright © 2016 NTT DATA Corporation
How does the VACUUM works actually?	
•  VACUUM works with two phases;
1.  Scan table to collect TID
2.  Reclaim garbage (Table, Index)
maintenance_work_mem	
Index
	
Table
Scan
Table
Collect
garbage TID
Reclaim
garbages
1st Phase
2nd Phase
13Copyright © 2016 NTT DATA Corporation
Performance improvement point of VACUUM	
•  Scan table page one by one.
•  vacuum can skip, iff there are more than 32 consecutive all-visible pages
•  Store and remember garbage tuple ID to maintenance_work_mem.
VACUUM can skip to scan efficiency.
SLOW!!FAST!
VACUUM needs to scan all page.
: all-visible block	
: Not all-visible block
Copyright © 2016 NTT DATA Corporation 14
XID wraparound and freezing tuple
15Copyright © 2016 NTT DATA Corporation
What is the transaction ID (XID)?	
•  Every tuple has two transaction IDs.
•  xmin : Inserted XID
•  xmax : Deleted/Updated XID
xmin | xmax | col
-------+------+------
1810 | 1820 | AAA
1812 | 0 | BBB
1814 | 1830 | CCC
1820 | 0 | XXX
In REPEATABLE READ transaction isolation level,
•  Transaction 1815 can see ‘AAA’, ‘BBB’ and ‘CCC’.
•  Transaction 1821 can see ‘BBB’, ‘CCC’ and ‘XXX’
•  Transaction 1831 can see ‘BBB’ and ‘XXX’.
16Copyright © 2016 NTT DATA Corporation
What is the transaction ID (XID)?	
•  Can represent up to 4 billion transactions (uint32).
•  XID space is circular with no endpoint.
•  There are 2 billion XIDs that are “older”, 2 billion XIDs that are “newer”.	
0232-1
Older
(Not visible)	
Newer
(Visible)
17Copyright © 2016 NTT DATA Corporation
What is the XID wraparound?	
XID=100	
XID=100	
XID 100 become
not visible	
XID=100	
Older
(Visible)	
Newer
(Not visible)	
XID 100 is visible	
Older
(Not visible)	
 Older
(Not visible)	
Newer
(Visible)	
Newer
(Visible)	
Still visible	
•  Postgres could loss the very old data due to XID wraparound.
•  When tuple is more than 2 billion transaction old, it could be happen.
•  If 200 TPS system, it’s happen every 120 days.
•  Note that it could be happen on INSERT-only table.
18Copyright © 2016 NTT DATA Corporation
Freezing tuple	
•  Mark tuple as “FREEZE”
•  Marking “frozen” means that it will appear to be “in the past” to all transaction.
•  Must freeze old tuple *before* XID proceeds 2 billion.	
XID=100
(FREEZE)	
XID=100
(FREEZE)	
Tuple is visible.
XID=100	
Older
(Visible)	
Newer
(Not visible)	
XID 100 is visible	
Older
(Not visible)	
 Older
(Not visible)	
Newer
(Visible)	
Newer
(Visible)	
Still visible.
Tuple is marked as
‘FREEZE’
19Copyright © 2016 NTT DATA Corporation
To prevent old data loss due to XID wraparound	
•  Emit WARNING log at 10 million transactions remaining.
•  Prohibit to generate new XID at 1 million transactions remaining.
•  Run anti-wraparound VACUUM automatically.
Copyright © 2016 NTT DATA Corporation 20
anti-wraparound VACUUM
21Copyright © 2016 NTT DATA Corporation
Anti-wraparound VACUUM	
•  All table has pg_class.relfrozenxid value.
•  All tuples which had been inserted by XID older than relfrozenxid have been
marked as “FREEZE”.
•  Same as forcibly executed VACUUM *FREEZE*.
Current XID	
pg_class.
relfrozenxid	
anti-
wraparound
VACUUM is
launched
forcibly	
VACUUM could
do a whole
table scan	
autovacuum_max_freeze_age
(default 200 million)	
+ 2 billion	
vacuum_freeze_table_age
(default 150 million)	
XID
wraparound
22Copyright © 2016 NTT DATA Corporation
Anti-wraparound VACUUM	
At this XID, lazy VACUUM is
executed.	
Current XID	
pg_class.
relfrozenxid	
anti-
wraparound
VACUUM is
launched
forcibly	
VACUUM could
do a whole
table scan	
autovacuum_max_freeze_age
(default 200 million)	
+ 2 billion	
vacuum_freeze_table_age
(default 150 million)	
XID
wraparound	
VACUUM
23Copyright © 2016 NTT DATA Corporation
VACUUM could
do a whole
table scan	
Anti-wraparound VACUUM	
If you execute VACUUM at this XID,
anti-wraparound VACUUM will be
executed.	
If you do VACUUM at this XID,
anti-wraparound VACUUM is
executed.	
pg_class.
relfrozenxid	
anti-
wraparound
VACUUM is
launched
forcibly	
autovacuum_max_freeze_age
(default 200 million)	
+ 2 billion	
vacuum_freeze_table_age
(default 150 million)	
XID
wraparound	
anti-wraparound
VACUUM
	
Current XID
24Copyright © 2016 NTT DATA Corporation
Anti-wraparound VACUUM	
After current XID is exceeded, anti-
wraparound VACUUM is launched
forcibly by autovacuum.
pg_class.
relfrozenxid	
anti-
wraparound
VACUUM is
launched
forcibly	
autovacuum_max_freeze_age
(default 200 million)	
+ 2 billion	
vacuum_freeze_table_age
(default 150 million)	
XID
wraparound	
anti-wraparound
auto VACUUM
	
Current XID	
VACUUM could
do a whole
table scan
25Copyright © 2016 NTT DATA Corporation
Anti-wraparound VACUUM	
After anti-wraparound VACUUM,
relrozenxid value is updated.
Current XID	
pg_class.
relfrozenxid	
vacuum_freeze_min_age
(default 50 million)
26Copyright © 2016 NTT DATA Corporation
anti-wraparound VACUUM is too slow	
•  Scanning whole table is always needed.
•  Because lazy vacuum could skip page having the visible but not frozen tuple.	
Visibility
Map
Block
#
xmin
0	
 0	
FREEZE
FREEZE
1	
 1	
FREEZE
FREEZE
1	
 2	
101
102
103
0	
 3	
Garbage
104
Lazy
VACUUM	
Anti-
wraparound
VACUUM
Copyright © 2016 NTT DATA Corporation 27
How can we improve anti-wraparound VACUUM?
28Copyright © 2016 NTT DATA Corporation
Approaches	
•  Freeze Map
•  Track pages which are necessary to be frozen.
•  64bit XID
•  Change size of XID from 32bit to 64bit.
•  LSN to XID map
•  Mapping XID to LSN.
29Copyright © 2016 NTT DATA Corporation
Freeze Map	
•  New feature for 9.6.
•  Improve VACUUM FREEZE, anti-wraparound VACUUM performance.
•  Bring us to functionality for VLDB.
30Copyright © 2016 NTT DATA Corporation
Idea - Add an additional bit	
•  Not adding new map.
•  Add a additional bit to Visibility Map.
•  The additional bits tracks which pages are all-frozen.
•  All-frozen page should be all-visible as well.
10110010	
all-visible	
 all-frozen
31Copyright © 2016 NTT DATA Corporation
State transition of two bits	
00	
10	
 11	
all-visible	
 all-frozen	
VACUUM
UPDATE/
DELETE/
INSERT	
UPDATE/
DELETE/
INSERT	
VACUUM
FREEZE
VACUUM
FREEZE
32Copyright © 2016 NTT DATA Corporation
Idea - Improve anti-wraparound VACUUM performance	
•  VACUUM can skip all-frozen page even if anti-wraparound VACUUM is
required.
Lazy
VACUUM	
Anti-
wraparound
VACUUM	
Visiblity Map Block
#
xmin
visible frozen
1	
 0	
 0	
FREEZE
FREEZE
1	
 1	
 1	
FREEZE
FREEZE
1	
 0	
 2	
101
102
103
0	
 0	
 3	
Garbage
104
33Copyright © 2016 NTT DATA Corporation
Pros/Cons	
•  Pros
•  Dramatically performance improvement for VACUUM FREEZE.
•  Read only table. (future)
•  Cons
•  Bloat Visibility Map size as twice.
34Copyright © 2016 NTT DATA Corporation
No More Full-Table Vacuums	
http://rhaas.blogspot.jp/2016/03/no-more-full-table-vacuums.html#comment-form
Copyright © 2016 NTT DATA Corporation 35
Another work
36Copyright © 2016 NTT DATA Corporation
Vacuum Progress Checker	
•  New feature for 9.6. (under reviewing)
•  Report progress information of VACUUM via system view.
37Copyright © 2016 NTT DATA Corporation
Idea	
•  Add new system view.
•  Report meaningful progress information for detail per process doing VACUUM.	
postgres(1)=# SELECT * FROM pg_stat_progress_vacuum ;
-[ RECORD 1 ]------+--------------
pid | 22611
datid | 13250
datname | postgres
relid | 16390
phase | scanning heap
heap_blks_total | 81968
heap_blks_scanned | 80768
heap_blks_vacuumed | 0
index_vacuum_count | 0
max_dead_tuples | 11184810
num_dead_tuples | 0
38Copyright © 2016 NTT DATA Corporation
Future works	
•  Read Only Table
•  Report progress information of other maintenance command.
Copyright © 2011 NTT DATA Corporation
Copyright © 2016 NTT DATA Corporation
PostgreSQL git repository
git://git.postgresql.org/git/postgresql.git
40Copyright © 2016 NTT DATA Corporation
VERBOSE option	
=# VACUUM VERBOSE hoge;
INFO: vacuuming "public.hoge"
INFO: scanned index "hoge_idx1" to remove 1000 row versions
DETAIL: CPU 0.00s/0.01u sec elapsed 0.01 sec.
INFO: "hoge": removed 1000 row versions in 443 pages
DETAIL: CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: index "hoge_idx1" now contains 100000 row versions in 276
pages
DETAIL: 1000 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: "hoge": found 1000 removable, 100000 nonremovable row
versions in 447 out of 447 pages
DETAIL: 0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.05u sec elapsed 0.05 sec.
VACUUM
41Copyright © 2016 NTT DATA Corporation
FREEZE option	
•  Aggressive freezing of tuples
•  Same as running normal VACUUM with vacuum_freeze_min_age = 0 and
vacuum_freeze_table_age = 0
•  Always scan whole table
42Copyright © 2016 NTT DATA Corporation
ANALYZE option	
•  Do ANALYZE after VACUUM
•  Update data statistics used by planner	
-- VACUUM and analyze with VERBOSE option
=# VACUUM ANALYZE VERBOSE hoge;
INFO: vacuuming "public.hoge"
:
INFO: analyzing "public.hoge"
INFO: "hoge": scanned 452 of 452 pages, containing 100000 live rows and
0 dead rows; 30000 rows in sample, 100000 estimated total rows
VACUUM
43Copyright © 2016 NTT DATA Corporation
FULL option	
•  Completely different from lazy VACUUM
•  Similar to CLUSTER
•  Acquire AccessExclusiveLock
•  Take much longer than lazy VACUUM
•  Need more space at most twice as table size.
•  Rebuild table and indexes
•  Freeze tuple while VACUUM FULL (9.3~)

Weitere ähnliche Inhalte

Was ist angesagt?

Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDBSage Weil
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 
PostgreSql query planning and tuning
PostgreSql query planning and tuningPostgreSql query planning and tuning
PostgreSql query planning and tuningFederico Campoli
 
Tuning Autovacuum in Postgresql
Tuning Autovacuum in PostgresqlTuning Autovacuum in Postgresql
Tuning Autovacuum in PostgresqlMydbops
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresEDB
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxNeoClova
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
Apache doris (incubating) introduction
Apache doris (incubating) introductionApache doris (incubating) introduction
Apache doris (incubating) introductionleanderlee2
 
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...confluent
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...OpenStack Korea Community
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sGerger
 
Spark and S3 with Ryan Blue
Spark and S3 with Ryan BlueSpark and S3 with Ryan Blue
Spark and S3 with Ryan BlueDatabricks
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesYoshinori Matsunobu
 
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfJesmar Cannao'
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용I Goo Lee
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTI Goo Lee
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera ClusterAbdul Manaf
 

Was ist angesagt? (20)

Ceph and RocksDB
Ceph and RocksDBCeph and RocksDB
Ceph and RocksDB
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
PostgreSql query planning and tuning
PostgreSql query planning and tuningPostgreSql query planning and tuning
PostgreSql query planning and tuning
 
Tuning Autovacuum in Postgresql
Tuning Autovacuum in PostgresqlTuning Autovacuum in Postgresql
Tuning Autovacuum in Postgresql
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Apache doris (incubating) introduction
Apache doris (incubating) introductionApache doris (incubating) introduction
Apache doris (incubating) introduction
 
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...
From Postgres to Event-Driven: using docker-compose to build CDC pipelines in...
 
PostgreSQL: XID周回問題に潜む別の問題
PostgreSQL: XID周回問題に潜む別の問題PostgreSQL: XID周回問題に潜む別の問題
PostgreSQL: XID周回問題に潜む別の問題
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA's
 
Spark and S3 with Ryan Blue
Spark and S3 with Ryan BlueSpark and S3 with Ryan Blue
Spark and S3 with Ryan Blue
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability Practices
 
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용MySQL 상태 메시지 분석 및 활용
MySQL 상태 메시지 분석 및 활용
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
AWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMTAWS 환경에서 MySQL BMT
AWS 환경에서 MySQL BMT
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 

Andere mochten auch

PostgreSQL: Past present Future
PostgreSQL: Past present FuturePostgreSQL: Past present Future
PostgreSQL: Past present FuturePGConf APAC
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentPGConf APAC
 
24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQLInMobi Technology
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...Mark Wong
 
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJava Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJAXLondon_Conference
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci CompliaceDenish Patel
 
Microservices Past, Present, Future
Microservices Past, Present, FutureMicroservices Past, Present, Future
Microservices Past, Present, FutureDavid Dawson
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014EDB
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기PgDay.Seoul
 
PostgreSQL Enterprise Class Features and Capabilities
PostgreSQL Enterprise Class Features and CapabilitiesPostgreSQL Enterprise Class Features and Capabilities
PostgreSQL Enterprise Class Features and CapabilitiesPGConf APAC
 
PostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPGConf APAC
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesPGConf APAC
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tPGConf APAC
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollPGConf APAC
 
Query Parallelism in PostgreSQL: What's coming next?
Query Parallelism in PostgreSQL: What's coming next?Query Parallelism in PostgreSQL: What's coming next?
Query Parallelism in PostgreSQL: What's coming next?PGConf APAC
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!PGConf APAC
 
Managing replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsManaging replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsFuenteovejuna
 
On The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterOn The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterSrihari Sriraman
 

Andere mochten auch (20)

PostgreSQL: Past present Future
PostgreSQL: Past present FuturePostgreSQL: Past present Future
PostgreSQL: Past present Future
 
Security Best Practices for your Postgres Deployment
Security Best Practices for your Postgres DeploymentSecurity Best Practices for your Postgres Deployment
Security Best Practices for your Postgres Deployment
 
24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL24/7 Monitoring and Alerting of PostgreSQL
24/7 Monitoring and Alerting of PostgreSQL
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
 
Secure PostgreSQL deployment
Secure PostgreSQL deploymentSecure PostgreSQL deployment
Secure PostgreSQL deployment
 
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel UrmaJava Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
Java Generics Past, Present and Future - Richard Warburton, Raoul-Gabriel Urma
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci Compliace
 
Microservices Past, Present, Future
Microservices Past, Present, FutureMicroservices Past, Present, Future
Microservices Past, Present, Future
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기
 
PostgreSQL Enterprise Class Features and Capabilities
PostgreSQL Enterprise Class Features and CapabilitiesPostgreSQL Enterprise Class Features and Capabilities
PostgreSQL Enterprise Class Features and Capabilities
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
 
PostgreSQL on Amazon RDS
PostgreSQL on Amazon RDSPostgreSQL on Amazon RDS
PostgreSQL on Amazon RDS
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst Practices
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
 
How to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'rollHow to teach an elephant to rock'n'roll
How to teach an elephant to rock'n'roll
 
Query Parallelism in PostgreSQL: What's coming next?
Query Parallelism in PostgreSQL: What's coming next?Query Parallelism in PostgreSQL: What's coming next?
Query Parallelism in PostgreSQL: What's coming next?
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!
 
Managing replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon RiggsManaging replication of PostgreSQL, Simon Riggs
Managing replication of PostgreSQL, Simon Riggs
 
On The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterOn The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL Cluster
 

Ähnlich wie Introduction to Vacuum Freezing and XID

Vacuum more efficient than ever
Vacuum more efficient than everVacuum more efficient than ever
Vacuum more efficient than everMasahiko Sawada
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...VirtualTech Japan Inc.
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLMasahiko Sawada
 
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...DataStax
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Cloudera, Inc.
 
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platformcloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
cloudera Apache Kudu Updatable Analytical Storage for Modern Data PlatformRakuten Group, Inc.
 
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph Ceph Community
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)Jaroslav Jacjuk
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...Michal Němec
 
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...VirtualTech Japan Inc.
 
2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310aKen Igarashi
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorMasahiko Sawada
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld
 
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015odpeer
 
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...Henning Jacobs
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Continuent
 
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?Anne Nicolas
 
How to deploy SQL Server on an Microsoft Azure virtual machines
How to deploy SQL Server on an Microsoft Azure virtual machinesHow to deploy SQL Server on an Microsoft Azure virtual machines
How to deploy SQL Server on an Microsoft Azure virtual machinesSolarWinds
 
It's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftIt's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftScyllaDB
 

Ähnlich wie Introduction to Vacuum Freezing and XID (20)

Vacuum more efficient than ever
Vacuum more efficient than everVacuum more efficient than ever
Vacuum more efficient than ever
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQL
 
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
 
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
Apache Kudu (Incubating): New Hadoop Storage for Fast Analytics on Fast Data ...
 
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platformcloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
cloudera Apache Kudu Updatable Analytical Storage for Modern Data Platform
 
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
Ceph Day Tokyo - Bit-Isle's 3 years footprint with Ceph
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
 
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...
Design and Operation of OpenStack Cloud on 100 Physical Servers - OpenStack S...
 
2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a2014-4Q-OpenStack-Fall-presentation-public-20150310a
2014-4Q-OpenStack-Fall-presentation-public-20150310a
 
Stabilizing Ceph
Stabilizing CephStabilizing Ceph
Stabilizing Ceph
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributor
 
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
VMworld 2013: Just Because You Could, Doesn't Mean You Should: Lessons Learne...
 
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015
Cassandra on Azure - "Tel-Aviv-Cassandra-Users" meetup 2015
 
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - Cont...
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
 
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
Embedded Recipes 2019 - RT is about to make it to mainline. Now what?
 
How to deploy SQL Server on an Microsoft Azure virtual machines
How to deploy SQL Server on an Microsoft Azure virtual machinesHow to deploy SQL Server on an Microsoft Azure virtual machines
How to deploy SQL Server on an Microsoft Azure virtual machines
 
It's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with UnikraftIt's Time to Debloat the Cloud with Unikraft
It's Time to Debloat the Cloud with Unikraft
 

Mehr von PGConf APAC

PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...PGConf APAC
 
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes LogicalPGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes LogicalPGConf APAC
 
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQLPGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQLPGConf APAC
 
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQLPGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQLPGConf APAC
 
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...PGConf APAC
 
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018PGConf APAC
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodbPGConf APAC
 
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at ScalePGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at ScalePGConf APAC
 
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQLPGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQLPGConf APAC
 
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC
 
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...PGConf APAC
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC
 
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...PGConf APAC
 
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC
 
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes elevenPGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes elevenPGConf APAC
 
Amazon (AWS) Aurora
Amazon (AWS) AuroraAmazon (AWS) Aurora
Amazon (AWS) AuroraPGConf APAC
 
Use Case: PostGIS and Agribotics
Use Case: PostGIS and AgriboticsUse Case: PostGIS and Agribotics
Use Case: PostGIS and AgriboticsPGConf APAC
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrPGConf APAC
 
(Ab)using 4d Indexing
(Ab)using 4d Indexing(Ab)using 4d Indexing
(Ab)using 4d IndexingPGConf APAC
 

Mehr von PGConf APAC (20)

PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
 
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes LogicalPGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
 
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQLPGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
 
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQLPGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
 
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
 
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at ScalePGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
 
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQLPGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
 
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
 
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
 
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
 
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from TrenchesPGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 - Tale from Trenches
 
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes elevenPGConf APAC 2018 Keynote: PostgreSQL goes eleven
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
 
Amazon (AWS) Aurora
Amazon (AWS) AuroraAmazon (AWS) Aurora
Amazon (AWS) Aurora
 
Use Case: PostGIS and Agribotics
Use Case: PostGIS and AgriboticsUse Case: PostGIS and Agribotics
Use Case: PostGIS and Agribotics
 
Swapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgrSwapping Pacemaker Corosync with repmgr
Swapping Pacemaker Corosync with repmgr
 
(Ab)using 4d Indexing
(Ab)using 4d Indexing(Ab)using 4d Indexing
(Ab)using 4d Indexing
 

Kürzlich hochgeladen

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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.pdfsudhanshuwaghmare1
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
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
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Introduction to Vacuum Freezing and XID

  • 1. Copyright © 2016 NTT DATA Corporation 03/17/2016 NTT DATA Corporation Masahiko Sawada Introduction to VACUUM, FREEZING and XID wraparound
  • 2. 2Copyright © 2016NTT DATA Corporation A little about me Ø  Masahiko Sawada Ø  twitter : @sawada_masahiko Ø  NTT DATA Corporation Ø  Database engineer Ø  PostgreSQL Hacker Ø  Core feature Ø  pg_bigm (PostgreSQL full text search module for multi-byte language)
  • 3. 3Copyright © 2016NTT DATA Corporation Contents •  VACUUM •  Visibility Map •  Freezing Tuple •  XID wraparound •  New VACUUM feature for 9.6
  • 4. Copyright © 2016 NTT DATA Corporation 4 What is the VACUUM?
  • 5. 5Copyright © 2016 NTT DATA Corporation VACUUM 1 AAA 2 BBB 3 CCC 2 bbb 4 DDD Concurrently INSERT/DELETE/UPDATE 1 AAA 2 BBB 3 CCC 2 bbb 1 AAA 3 CCC 2 bbb 4 DDD VACUUM Starts VACUUM Done FSM UPDATE : BBB->bbb •  Postgres garbage collection feature •  Acquire ShareUpdateExclusive Lock
  • 6. 6Copyright © 2016 NTT DATA Corporation Why do we need to VACUUM? •  Recover or reuse disk space occupied •  Update data statistics •  Update visibility map to speed up Index-Only Scan. •  Protect against loss of very old data due to XID wraparound
  • 7. 7Copyright © 2016 NTT DATA Corporation Evolution history of VACUUM v8.1 (2005) v8.4 (2009) autovacuum !? Visibility Map Free Space Map v9.5 (2016) vacuumdb parallel option v9.6
  • 8. 8Copyright © 2016 NTT DATA Corporation VACUUM Syntax -- VACUUM whole database =# VACUUM; -- Multiple option, analyzing only col1 column =# VACUUM FREEZE VERBOSE ANALYZE hoge (col1); -- Multiple option with parentheses =# VACUUM (FULL, ANALYZE, VERBOSE) hoge;
  • 9. Copyright © 2016 NTT DATA Corporation 9 Visibility Map
  • 10. 10Copyright © 2016 NTT DATA Corporation Visibility Map •  Introduced at 8.4 •  A bit map for each table (1 bit per 1 page) •  A table relation can have a visibility map. •  keep track of which pages are all-visible page •  keep track of which pages are having garbage. •  If 500GB table, Visibility Map is less than 10MB. Table (base/XXX/1234) Visibility Map (base/XXX/1234_vm) Block 0 Block 1 Block 2 Block 3 Block 4 11001…
  • 11. 11Copyright © 2016 NTT DATA Corporation State transition of Visibility Map bit VACUUM 0 1 INSERT, UPDATE, DELETE (NOT all-visible) (all-visible)
  • 12. 12Copyright © 2016 NTT DATA Corporation How does the VACUUM works actually? •  VACUUM works with two phases; 1.  Scan table to collect TID 2.  Reclaim garbage (Table, Index) maintenance_work_mem Index Table Scan Table Collect garbage TID Reclaim garbages 1st Phase 2nd Phase
  • 13. 13Copyright © 2016 NTT DATA Corporation Performance improvement point of VACUUM •  Scan table page one by one. •  vacuum can skip, iff there are more than 32 consecutive all-visible pages •  Store and remember garbage tuple ID to maintenance_work_mem. VACUUM can skip to scan efficiency. SLOW!!FAST! VACUUM needs to scan all page. : all-visible block : Not all-visible block
  • 14. Copyright © 2016 NTT DATA Corporation 14 XID wraparound and freezing tuple
  • 15. 15Copyright © 2016 NTT DATA Corporation What is the transaction ID (XID)? •  Every tuple has two transaction IDs. •  xmin : Inserted XID •  xmax : Deleted/Updated XID xmin | xmax | col -------+------+------ 1810 | 1820 | AAA 1812 | 0 | BBB 1814 | 1830 | CCC 1820 | 0 | XXX In REPEATABLE READ transaction isolation level, •  Transaction 1815 can see ‘AAA’, ‘BBB’ and ‘CCC’. •  Transaction 1821 can see ‘BBB’, ‘CCC’ and ‘XXX’ •  Transaction 1831 can see ‘BBB’ and ‘XXX’.
  • 16. 16Copyright © 2016 NTT DATA Corporation What is the transaction ID (XID)? •  Can represent up to 4 billion transactions (uint32). •  XID space is circular with no endpoint. •  There are 2 billion XIDs that are “older”, 2 billion XIDs that are “newer”. 0232-1 Older (Not visible) Newer (Visible)
  • 17. 17Copyright © 2016 NTT DATA Corporation What is the XID wraparound? XID=100 XID=100 XID 100 become not visible XID=100 Older (Visible) Newer (Not visible) XID 100 is visible Older (Not visible) Older (Not visible) Newer (Visible) Newer (Visible) Still visible •  Postgres could loss the very old data due to XID wraparound. •  When tuple is more than 2 billion transaction old, it could be happen. •  If 200 TPS system, it’s happen every 120 days. •  Note that it could be happen on INSERT-only table.
  • 18. 18Copyright © 2016 NTT DATA Corporation Freezing tuple •  Mark tuple as “FREEZE” •  Marking “frozen” means that it will appear to be “in the past” to all transaction. •  Must freeze old tuple *before* XID proceeds 2 billion. XID=100 (FREEZE) XID=100 (FREEZE) Tuple is visible. XID=100 Older (Visible) Newer (Not visible) XID 100 is visible Older (Not visible) Older (Not visible) Newer (Visible) Newer (Visible) Still visible. Tuple is marked as ‘FREEZE’
  • 19. 19Copyright © 2016 NTT DATA Corporation To prevent old data loss due to XID wraparound •  Emit WARNING log at 10 million transactions remaining. •  Prohibit to generate new XID at 1 million transactions remaining. •  Run anti-wraparound VACUUM automatically.
  • 20. Copyright © 2016 NTT DATA Corporation 20 anti-wraparound VACUUM
  • 21. 21Copyright © 2016 NTT DATA Corporation Anti-wraparound VACUUM •  All table has pg_class.relfrozenxid value. •  All tuples which had been inserted by XID older than relfrozenxid have been marked as “FREEZE”. •  Same as forcibly executed VACUUM *FREEZE*. Current XID pg_class. relfrozenxid anti- wraparound VACUUM is launched forcibly VACUUM could do a whole table scan autovacuum_max_freeze_age (default 200 million) + 2 billion vacuum_freeze_table_age (default 150 million) XID wraparound
  • 22. 22Copyright © 2016 NTT DATA Corporation Anti-wraparound VACUUM At this XID, lazy VACUUM is executed. Current XID pg_class. relfrozenxid anti- wraparound VACUUM is launched forcibly VACUUM could do a whole table scan autovacuum_max_freeze_age (default 200 million) + 2 billion vacuum_freeze_table_age (default 150 million) XID wraparound VACUUM
  • 23. 23Copyright © 2016 NTT DATA Corporation VACUUM could do a whole table scan Anti-wraparound VACUUM If you execute VACUUM at this XID, anti-wraparound VACUUM will be executed. If you do VACUUM at this XID, anti-wraparound VACUUM is executed. pg_class. relfrozenxid anti- wraparound VACUUM is launched forcibly autovacuum_max_freeze_age (default 200 million) + 2 billion vacuum_freeze_table_age (default 150 million) XID wraparound anti-wraparound VACUUM Current XID
  • 24. 24Copyright © 2016 NTT DATA Corporation Anti-wraparound VACUUM After current XID is exceeded, anti- wraparound VACUUM is launched forcibly by autovacuum. pg_class. relfrozenxid anti- wraparound VACUUM is launched forcibly autovacuum_max_freeze_age (default 200 million) + 2 billion vacuum_freeze_table_age (default 150 million) XID wraparound anti-wraparound auto VACUUM Current XID VACUUM could do a whole table scan
  • 25. 25Copyright © 2016 NTT DATA Corporation Anti-wraparound VACUUM After anti-wraparound VACUUM, relrozenxid value is updated. Current XID pg_class. relfrozenxid vacuum_freeze_min_age (default 50 million)
  • 26. 26Copyright © 2016 NTT DATA Corporation anti-wraparound VACUUM is too slow •  Scanning whole table is always needed. •  Because lazy vacuum could skip page having the visible but not frozen tuple. Visibility Map Block # xmin 0 0 FREEZE FREEZE 1 1 FREEZE FREEZE 1 2 101 102 103 0 3 Garbage 104 Lazy VACUUM Anti- wraparound VACUUM
  • 27. Copyright © 2016 NTT DATA Corporation 27 How can we improve anti-wraparound VACUUM?
  • 28. 28Copyright © 2016 NTT DATA Corporation Approaches •  Freeze Map •  Track pages which are necessary to be frozen. •  64bit XID •  Change size of XID from 32bit to 64bit. •  LSN to XID map •  Mapping XID to LSN.
  • 29. 29Copyright © 2016 NTT DATA Corporation Freeze Map •  New feature for 9.6. •  Improve VACUUM FREEZE, anti-wraparound VACUUM performance. •  Bring us to functionality for VLDB.
  • 30. 30Copyright © 2016 NTT DATA Corporation Idea - Add an additional bit •  Not adding new map. •  Add a additional bit to Visibility Map. •  The additional bits tracks which pages are all-frozen. •  All-frozen page should be all-visible as well. 10110010 all-visible all-frozen
  • 31. 31Copyright © 2016 NTT DATA Corporation State transition of two bits 00 10 11 all-visible all-frozen VACUUM UPDATE/ DELETE/ INSERT UPDATE/ DELETE/ INSERT VACUUM FREEZE VACUUM FREEZE
  • 32. 32Copyright © 2016 NTT DATA Corporation Idea - Improve anti-wraparound VACUUM performance •  VACUUM can skip all-frozen page even if anti-wraparound VACUUM is required. Lazy VACUUM Anti- wraparound VACUUM Visiblity Map Block # xmin visible frozen 1 0 0 FREEZE FREEZE 1 1 1 FREEZE FREEZE 1 0 2 101 102 103 0 0 3 Garbage 104
  • 33. 33Copyright © 2016 NTT DATA Corporation Pros/Cons •  Pros •  Dramatically performance improvement for VACUUM FREEZE. •  Read only table. (future) •  Cons •  Bloat Visibility Map size as twice.
  • 34. 34Copyright © 2016 NTT DATA Corporation No More Full-Table Vacuums http://rhaas.blogspot.jp/2016/03/no-more-full-table-vacuums.html#comment-form
  • 35. Copyright © 2016 NTT DATA Corporation 35 Another work
  • 36. 36Copyright © 2016 NTT DATA Corporation Vacuum Progress Checker •  New feature for 9.6. (under reviewing) •  Report progress information of VACUUM via system view.
  • 37. 37Copyright © 2016 NTT DATA Corporation Idea •  Add new system view. •  Report meaningful progress information for detail per process doing VACUUM. postgres(1)=# SELECT * FROM pg_stat_progress_vacuum ; -[ RECORD 1 ]------+-------------- pid | 22611 datid | 13250 datname | postgres relid | 16390 phase | scanning heap heap_blks_total | 81968 heap_blks_scanned | 80768 heap_blks_vacuumed | 0 index_vacuum_count | 0 max_dead_tuples | 11184810 num_dead_tuples | 0
  • 38. 38Copyright © 2016 NTT DATA Corporation Future works •  Read Only Table •  Report progress information of other maintenance command.
  • 39. Copyright © 2011 NTT DATA Corporation Copyright © 2016 NTT DATA Corporation PostgreSQL git repository git://git.postgresql.org/git/postgresql.git
  • 40. 40Copyright © 2016 NTT DATA Corporation VERBOSE option =# VACUUM VERBOSE hoge; INFO: vacuuming "public.hoge" INFO: scanned index "hoge_idx1" to remove 1000 row versions DETAIL: CPU 0.00s/0.01u sec elapsed 0.01 sec. INFO: "hoge": removed 1000 row versions in 443 pages DETAIL: CPU 0.00s/0.00u sec elapsed 0.00 sec. INFO: index "hoge_idx1" now contains 100000 row versions in 276 pages DETAIL: 1000 index row versions were removed. 0 index pages have been deleted, 0 are currently reusable. CPU 0.00s/0.00u sec elapsed 0.00 sec. INFO: "hoge": found 1000 removable, 100000 nonremovable row versions in 447 out of 447 pages DETAIL: 0 dead row versions cannot be removed yet. There were 0 unused item pointers. Skipped 0 pages due to buffer pins. 0 pages are entirely empty. CPU 0.00s/0.05u sec elapsed 0.05 sec. VACUUM
  • 41. 41Copyright © 2016 NTT DATA Corporation FREEZE option •  Aggressive freezing of tuples •  Same as running normal VACUUM with vacuum_freeze_min_age = 0 and vacuum_freeze_table_age = 0 •  Always scan whole table
  • 42. 42Copyright © 2016 NTT DATA Corporation ANALYZE option •  Do ANALYZE after VACUUM •  Update data statistics used by planner -- VACUUM and analyze with VERBOSE option =# VACUUM ANALYZE VERBOSE hoge; INFO: vacuuming "public.hoge" : INFO: analyzing "public.hoge" INFO: "hoge": scanned 452 of 452 pages, containing 100000 live rows and 0 dead rows; 30000 rows in sample, 100000 estimated total rows VACUUM
  • 43. 43Copyright © 2016 NTT DATA Corporation FULL option •  Completely different from lazy VACUUM •  Similar to CLUSTER •  Acquire AccessExclusiveLock •  Take much longer than lazy VACUUM •  Need more space at most twice as table size. •  Rebuild table and indexes •  Freeze tuple while VACUUM FULL (9.3~)