SlideShare a Scribd company logo
1 of 43
Download to read offline
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~)

More Related Content

What's hot

PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSTomas Vondra
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationAlexey Lesovsky
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyAlexander Kukushkin
 
PostgreSQL Streaming Replication Cheatsheet
PostgreSQL Streaming Replication CheatsheetPostgreSQL Streaming Replication Cheatsheet
PostgreSQL Streaming Replication CheatsheetAlexey Lesovsky
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldJignesh Shah
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux ContainersJignesh Shah
 
Vacuum in PostgreSQL
Vacuum in PostgreSQLVacuum in PostgreSQL
Vacuum in PostgreSQLRafia Sabih
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper lookJignesh Shah
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesJimmy Angelakos
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on LinuxPawan Kumar
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLMasahiko Sawada
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep InternalEXEM
 
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...NTT DATA Technology & Innovation
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...ScaleGrid.io
 

What's hot (20)

PostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFSPostgreSQL on EXT4, XFS, BTRFS and ZFS
PostgreSQL on EXT4, XFS, BTRFS and ZFS
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming Replication
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
PostgreSQL Streaming Replication Cheatsheet
PostgreSQL Streaming Replication CheatsheetPostgreSQL Streaming Replication Cheatsheet
PostgreSQL Streaming Replication Cheatsheet
 
PostgreSQL Replication Tutorial
PostgreSQL Replication TutorialPostgreSQL Replication Tutorial
PostgreSQL Replication Tutorial
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux Containers
 
Vacuum in PostgreSQL
Vacuum in PostgreSQLVacuum in PostgreSQL
Vacuum in PostgreSQL
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper look
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
 
MySQL with DRBD/Pacemaker/Corosync on Linux
 MySQL with DRBD/Pacemaker/Corosync on Linux MySQL with DRBD/Pacemaker/Corosync on Linux
MySQL with DRBD/Pacemaker/Corosync on Linux
 
Bloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQLBloat and Fragmentation in PostgreSQL
Bloat and Fragmentation in PostgreSQL
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
Backup and-recovery2
Backup and-recovery2Backup and-recovery2
Backup and-recovery2
 
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
オンライン物理バックアップの排他モードと非排他モードについて ~PostgreSQLバージョン15対応版~(第34回PostgreSQLアンカンファレンス...
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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.
 
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
 
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
 
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.
 
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
 
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...InfluxData
 

Similar to 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...
 
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...
 
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
 
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...
 
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
 
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...
Tobias Braun [Herrenknecht AG] | Going Underground with InfluxDB | InfluxDays...
 

More from 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
 

More from 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
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

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~)