SlideShare a Scribd company logo
1 of 42
Download to read offline
Copyright © 2016 NTT DATA Corporation
03/17/2016
NTT DATA Corporation
Masahiko Sawada
Introduction VACUUM, FREEZING, 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 (Multi-byte full text search module for PostgreSQL)
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 “Frozen”
•  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.
20Copyright © 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 “Frozen”.
•  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
21Copyright © 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
22Copyright © 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
23Copyright © 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
24Copyright © 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)
25Copyright © 2016 NTT DATA Corporation
anti-wraparound VACUUM is too slow	
•  Scanning whole table is always required to proceed relfrozenxid.
•  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
Normal
VACUUM	
Anti-
wraparound
VACUUM
Copyright © 2016 NTT DATA Corporation 26
How can we improve anti-wraparound VACUUM?
27Copyright © 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.
28Copyright © 2016 NTT DATA Corporation
Freeze Map	
•  New feature for 9.6.
•  Improve VACUUM FREEZE, anti-wraparound VACUUM performance.
•  Bring us to functionality for VLDB.
29Copyright © 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
30Copyright © 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
31Copyright © 2016 NTT DATA Corporation
Idea - Improve anti-wraparound performance	
•  VACUUM can skip all-frozen page even if anti-wraparound VACUUM is
required.
Normal
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
32Copyright © 2016 NTT DATA Corporation
Pros/Cons	
•  Pros
•  Dramatically performance improvement for VACUUM FREEZE.
•  Read only table. (future)
•  Cons
•  Bloat Visibility Map size as twice.
33Copyright © 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 34
Another work
35Copyright © 2016 NTT DATA Corporation
Vacuum Progress Checker	
•  New feature for 9.6. (under reviewing)
•  Report progress information of VACUUM via system view.
36Copyright © 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_vacuum_progress ;
-[ RECORD 1 ]-------+--------------
pid | 55513
relid | 16384
phase | Scanning Heap
total_heap_blks | 451372
current_heap_blkno | 77729
total_index_pages | 559364
scanned_index_pages | 559364
index_scan_count | 1
percent_complete | 17
37Copyright © 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
39Copyright © 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
40Copyright © 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
41Copyright © 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
42Copyright © 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

統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)NTT DATA Technology & Innovation
 
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우PgDay.Seoul
 
Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会Masahiko Sawada
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at NetflixBrendan Gregg
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfSrirakshaSrinivasan2
 
HOT Understanding this important update optimization
HOT Understanding this important update optimizationHOT Understanding this important update optimization
HOT Understanding this important update optimizationGrant McAlister
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱PgDay.Seoul
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper lookJignesh Shah
 
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)NTT DATA Technology & Innovation
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTanel Poder
 
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)NTT DATA Technology & Innovation
 
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)NTT DATA Technology & Innovation
 

What's hot (20)

統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
PostgreSQLレプリケーション10周年!徹底紹介!(PostgreSQL Conference Japan 2019講演資料)
 
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLの統計情報について(第26回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
 
Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会Inside vacuum - 第一回PostgreSQLプレ勉強会
Inside vacuum - 第一回PostgreSQLプレ勉強会
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
The PostgreSQL Query Planner
The PostgreSQL Query PlannerThe PostgreSQL Query Planner
The PostgreSQL Query Planner
 
HOT Understanding this important update optimization
HOT Understanding this important update optimizationHOT Understanding this important update optimization
HOT Understanding this important update optimization
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
 
いまさら聞けないPostgreSQL運用管理
いまさら聞けないPostgreSQL運用管理いまさら聞けないPostgreSQL運用管理
いまさら聞けないPostgreSQL運用管理
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper look
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQL 13でのpg_stat_statementsの改善について(第12回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)
PostgreSQLをKubernetes上で活用するためのOperator紹介!(Cloud Native Database Meetup #3 発表資料)
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)
速習!論理レプリケーション ~基礎から最新動向まで~(PostgreSQL Conference Japan 2022 発表資料)
 
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)
PostgreSQL 14 モニタリング新機能紹介(PostgreSQL カンファレンス #24、2021/06/08)
 

Viewers also liked

Праздник осени
Праздник осениПраздник осени
Праздник осениIrina Kutuzova
 
FEL Position Paper
FEL Position PaperFEL Position Paper
FEL Position Paperchitlesh
 
Blended-and-Braided-Funding_final
Blended-and-Braided-Funding_finalBlended-and-Braided-Funding_final
Blended-and-Braided-Funding_finalKC Jones
 
OBHE Presentation, Malcolm Read, JISC 3 november 2011
OBHE Presentation, Malcolm Read, JISC 3 november 2011OBHE Presentation, Malcolm Read, JISC 3 november 2011
OBHE Presentation, Malcolm Read, JISC 3 november 2011Jisc
 
Frases para la vida jesus vargas
Frases para la vida jesus vargasFrases para la vida jesus vargas
Frases para la vida jesus vargasJesus Vargas
 
Sales management 8 2014 van verkopen naar co creatie
Sales management 8 2014 van verkopen naar co creatieSales management 8 2014 van verkopen naar co creatie
Sales management 8 2014 van verkopen naar co creatieAntwerp Management School
 
Unit Testing with Nose
Unit Testing with NoseUnit Testing with Nose
Unit Testing with NoseVengat Vasanth
 
Shibboleth 2.0 IdP slides - Installfest (Edited)
Shibboleth 2.0 IdP slides - Installfest (Edited)Shibboleth 2.0 IdP slides - Installfest (Edited)
Shibboleth 2.0 IdP slides - Installfest (Edited)JISC.AM
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Appsdreamforce2006
 
áNgel luis 4º b. nuevas nike safari boots
áNgel luis 4º b.  nuevas nike safari bootsáNgel luis 4º b.  nuevas nike safari boots
áNgel luis 4º b. nuevas nike safari bootsadnaya
 
Representing Bicyclists CLE Materials
Representing Bicyclists CLE MaterialsRepresenting Bicyclists CLE Materials
Representing Bicyclists CLE MaterialsCharley Gee
 

Viewers also liked (20)

Mississippi flood 2011
Mississippi flood 2011Mississippi flood 2011
Mississippi flood 2011
 
Праздник осени
Праздник осениПраздник осени
Праздник осени
 
Ecologically Safe Monotheistic Solutions to Global Crisis Of The Finance System
Ecologically Safe Monotheistic Solutions to Global Crisis Of The Finance SystemEcologically Safe Monotheistic Solutions to Global Crisis Of The Finance System
Ecologically Safe Monotheistic Solutions to Global Crisis Of The Finance System
 
OrgCultureView_v0.1
OrgCultureView_v0.1OrgCultureView_v0.1
OrgCultureView_v0.1
 
01
0101
01
 
Conceitos Interativos08
Conceitos Interativos08Conceitos Interativos08
Conceitos Interativos08
 
FEL Position Paper
FEL Position PaperFEL Position Paper
FEL Position Paper
 
Blended-and-Braided-Funding_final
Blended-and-Braided-Funding_finalBlended-and-Braided-Funding_final
Blended-and-Braided-Funding_final
 
OBHE Presentation, Malcolm Read, JISC 3 november 2011
OBHE Presentation, Malcolm Read, JISC 3 november 2011OBHE Presentation, Malcolm Read, JISC 3 november 2011
OBHE Presentation, Malcolm Read, JISC 3 november 2011
 
Frases para la vida jesus vargas
Frases para la vida jesus vargasFrases para la vida jesus vargas
Frases para la vida jesus vargas
 
Sales management 8 2014 van verkopen naar co creatie
Sales management 8 2014 van verkopen naar co creatieSales management 8 2014 van verkopen naar co creatie
Sales management 8 2014 van verkopen naar co creatie
 
Weapons of Mass Deception by David Moosa Pidcock, Leader of Islamic Party of ...
Weapons of Mass Deception by David Moosa Pidcock, Leader of Islamic Party of ...Weapons of Mass Deception by David Moosa Pidcock, Leader of Islamic Party of ...
Weapons of Mass Deception by David Moosa Pidcock, Leader of Islamic Party of ...
 
Unit Testing with Nose
Unit Testing with NoseUnit Testing with Nose
Unit Testing with Nose
 
Shibboleth 2.0 IdP slides - Installfest (Edited)
Shibboleth 2.0 IdP slides - Installfest (Edited)Shibboleth 2.0 IdP slides - Installfest (Edited)
Shibboleth 2.0 IdP slides - Installfest (Edited)
 
LOS RESULTADOS MARAVILLOSOS DE LA JUSTIFICACIÓN
LOS RESULTADOS MARAVILLOSOS DE LA JUSTIFICACIÓNLOS RESULTADOS MARAVILLOSOS DE LA JUSTIFICACIÓN
LOS RESULTADOS MARAVILLOSOS DE LA JUSTIFICACIÓN
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Apps
 
áNgel luis 4º b. nuevas nike safari boots
áNgel luis 4º b.  nuevas nike safari bootsáNgel luis 4º b.  nuevas nike safari boots
áNgel luis 4º b. nuevas nike safari boots
 
Regulamento Bom pra tudo
Regulamento Bom pra tudoRegulamento Bom pra tudo
Regulamento Bom pra tudo
 
Representing Bicyclists CLE Materials
Representing Bicyclists CLE MaterialsRepresenting Bicyclists CLE Materials
Representing Bicyclists CLE Materials
 
Meri_dliny1
Meri_dliny1Meri_dliny1
Meri_dliny1
 

Similar to Introduction VAUUM, Freezing, XID wraparound

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
 
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
 
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.
 
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.
 
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
 
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
 
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
 
DataCore Technology Overview
DataCore Technology OverviewDataCore Technology Overview
DataCore Technology OverviewJeff Slapp
 
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichData Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichRomeo Kienzler
 
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
 
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
 
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
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance AnalysisRodrigo Campos
 
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...DataStax
 
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
 

Similar to Introduction VAUUM, Freezing, XID wraparound (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...
 
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
 
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
 
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 ...
 
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...
 
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
 
Stabilizing Ceph
Stabilizing CephStabilizing Ceph
Stabilizing 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)
 
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...
 
DataCore Technology Overview
DataCore Technology OverviewDataCore Technology Overview
DataCore Technology Overview
 
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center ZurichData Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
Data Science Connect, July 22nd 2014 @IBM Innovation Center Zurich
 
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
 
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...
 
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?
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance Analysis
 
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
 
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
 

More from Masahiko Sawada

PostgreSQL 15の新機能を徹底解説
PostgreSQL 15の新機能を徹底解説PostgreSQL 15の新機能を徹底解説
PostgreSQL 15の新機能を徹底解説Masahiko Sawada
 
行ロックと「LOG: process 12345 still waiting for ShareLock on transaction 710 afte...
行ロックと「LOG:  process 12345 still waiting for ShareLock on transaction 710 afte...行ロックと「LOG:  process 12345 still waiting for ShareLock on transaction 710 afte...
行ロックと「LOG: process 12345 still waiting for ShareLock on transaction 710 afte...Masahiko Sawada
 
PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報Masahiko Sawada
 
Transparent Data Encryption in PostgreSQL
Transparent Data Encryption in PostgreSQLTransparent Data Encryption in PostgreSQL
Transparent Data Encryption in PostgreSQLMasahiko Sawada
 
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -Masahiko Sawada
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Masahiko Sawada
 
Database Encryption and Key Management for PostgreSQL - Principles and Consid...
Database Encryption and Key Management for PostgreSQL - Principles and Consid...Database Encryption and Key Management for PostgreSQL - Principles and Consid...
Database Encryption and Key Management for PostgreSQL - Principles and Consid...Masahiko Sawada
 
今秋リリース予定のPostgreSQL11を徹底解説
今秋リリース予定のPostgreSQL11を徹底解説今秋リリース予定のPostgreSQL11を徹底解説
今秋リリース予定のPostgreSQL11を徹底解説Masahiko Sawada
 
アーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーションアーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーションMasahiko Sawada
 
PostgreSQLでスケールアウト
PostgreSQLでスケールアウトPostgreSQLでスケールアウト
PostgreSQLでスケールアウトMasahiko Sawada
 
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~Masahiko Sawada
 
PostgreSQL10徹底解説
PostgreSQL10徹底解説PostgreSQL10徹底解説
PostgreSQL10徹底解説Masahiko Sawada
 
FDW-based Sharding Update and Future
FDW-based Sharding Update and FutureFDW-based Sharding Update and Future
FDW-based Sharding Update and FutureMasahiko Sawada
 
PostgreSQL 9.6 新機能紹介
PostgreSQL 9.6 新機能紹介PostgreSQL 9.6 新機能紹介
PostgreSQL 9.6 新機能紹介Masahiko Sawada
 
pg_bigmと類似度検索
pg_bigmと類似度検索pg_bigmと類似度検索
pg_bigmと類似度検索Masahiko Sawada
 
pg_bigmを触り始めた人に伝えたいこと
pg_bigmを触り始めた人に伝えたいことpg_bigmを触り始めた人に伝えたいこと
pg_bigmを触り始めた人に伝えたいことMasahiko Sawada
 

More from Masahiko Sawada (20)

PostgreSQL 15の新機能を徹底解説
PostgreSQL 15の新機能を徹底解説PostgreSQL 15の新機能を徹底解説
PostgreSQL 15の新機能を徹底解説
 
行ロックと「LOG: process 12345 still waiting for ShareLock on transaction 710 afte...
行ロックと「LOG:  process 12345 still waiting for ShareLock on transaction 710 afte...行ロックと「LOG:  process 12345 still waiting for ShareLock on transaction 710 afte...
行ロックと「LOG: process 12345 still waiting for ShareLock on transaction 710 afte...
 
PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報PostgreSQL 15 開発最新情報
PostgreSQL 15 開発最新情報
 
Vacuum徹底解説
Vacuum徹底解説Vacuum徹底解説
Vacuum徹底解説
 
Transparent Data Encryption in PostgreSQL
Transparent Data Encryption in PostgreSQLTransparent Data Encryption in PostgreSQL
Transparent Data Encryption in PostgreSQL
 
PostgreSQL 12の話
PostgreSQL 12の話PostgreSQL 12の話
PostgreSQL 12の話
 
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -
OSS活動のやりがいとそれから得たもの - PostgreSQLコミュニティにて -
 
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...Transparent Data Encryption in PostgreSQL and Integration with Key Management...
Transparent Data Encryption in PostgreSQL and Integration with Key Management...
 
Database Encryption and Key Management for PostgreSQL - Principles and Consid...
Database Encryption and Key Management for PostgreSQL - Principles and Consid...Database Encryption and Key Management for PostgreSQL - Principles and Consid...
Database Encryption and Key Management for PostgreSQL - Principles and Consid...
 
今秋リリース予定のPostgreSQL11を徹底解説
今秋リリース予定のPostgreSQL11を徹底解説今秋リリース予定のPostgreSQL11を徹底解説
今秋リリース予定のPostgreSQL11を徹底解説
 
Vacuumとzheap
VacuumとzheapVacuumとzheap
Vacuumとzheap
 
アーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーションアーキテクチャから理解するPostgreSQLのレプリケーション
アーキテクチャから理解するPostgreSQLのレプリケーション
 
Parallel Vacuum
Parallel VacuumParallel Vacuum
Parallel Vacuum
 
PostgreSQLでスケールアウト
PostgreSQLでスケールアウトPostgreSQLでスケールアウト
PostgreSQLでスケールアウト
 
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~
OSS 開発ってどうやっているの? ~ PostgreSQL の現場から~
 
PostgreSQL10徹底解説
PostgreSQL10徹底解説PostgreSQL10徹底解説
PostgreSQL10徹底解説
 
FDW-based Sharding Update and Future
FDW-based Sharding Update and FutureFDW-based Sharding Update and Future
FDW-based Sharding Update and Future
 
PostgreSQL 9.6 新機能紹介
PostgreSQL 9.6 新機能紹介PostgreSQL 9.6 新機能紹介
PostgreSQL 9.6 新機能紹介
 
pg_bigmと類似度検索
pg_bigmと類似度検索pg_bigmと類似度検索
pg_bigmと類似度検索
 
pg_bigmを触り始めた人に伝えたいこと
pg_bigmを触り始めた人に伝えたいことpg_bigmを触り始めた人に伝えたいこと
pg_bigmを触り始めた人に伝えたいこと
 

Recently uploaded

WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 

Recently uploaded (20)

WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 

Introduction VAUUM, Freezing, XID wraparound

  • 1. Copyright © 2016 NTT DATA Corporation 03/17/2016 NTT DATA Corporation Masahiko Sawada Introduction VACUUM, FREEZING, 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 (Multi-byte full text search module for PostgreSQL)
  • 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 “Frozen” •  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. 20Copyright © 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 “Frozen”. •  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
  • 21. 21Copyright © 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
  • 22. 22Copyright © 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
  • 23. 23Copyright © 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
  • 24. 24Copyright © 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)
  • 25. 25Copyright © 2016 NTT DATA Corporation anti-wraparound VACUUM is too slow •  Scanning whole table is always required to proceed relfrozenxid. •  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 Normal VACUUM Anti- wraparound VACUUM
  • 26. Copyright © 2016 NTT DATA Corporation 26 How can we improve anti-wraparound VACUUM?
  • 27. 27Copyright © 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.
  • 28. 28Copyright © 2016 NTT DATA Corporation Freeze Map •  New feature for 9.6. •  Improve VACUUM FREEZE, anti-wraparound VACUUM performance. •  Bring us to functionality for VLDB.
  • 29. 29Copyright © 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
  • 30. 30Copyright © 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
  • 31. 31Copyright © 2016 NTT DATA Corporation Idea - Improve anti-wraparound performance •  VACUUM can skip all-frozen page even if anti-wraparound VACUUM is required. Normal 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
  • 32. 32Copyright © 2016 NTT DATA Corporation Pros/Cons •  Pros •  Dramatically performance improvement for VACUUM FREEZE. •  Read only table. (future) •  Cons •  Bloat Visibility Map size as twice.
  • 33. 33Copyright © 2016 NTT DATA Corporation No More Full-Table Vacuums http://rhaas.blogspot.jp/2016/03/no-more-full-table-vacuums.html#comment-form
  • 34. Copyright © 2016 NTT DATA Corporation 34 Another work
  • 35. 35Copyright © 2016 NTT DATA Corporation Vacuum Progress Checker •  New feature for 9.6. (under reviewing) •  Report progress information of VACUUM via system view.
  • 36. 36Copyright © 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_vacuum_progress ; -[ RECORD 1 ]-------+-------------- pid | 55513 relid | 16384 phase | Scanning Heap total_heap_blks | 451372 current_heap_blkno | 77729 total_index_pages | 559364 scanned_index_pages | 559364 index_scan_count | 1 percent_complete | 17
  • 37. 37Copyright © 2016 NTT DATA Corporation Future works •  Read Only Table •  Report progress information of other maintenance command.
  • 38. Copyright © 2011 NTT DATA Corporation Copyright © 2016 NTT DATA Corporation PostgreSQL git repository git://git.postgresql.org/git/postgresql.git
  • 39. 39Copyright © 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
  • 40. 40Copyright © 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
  • 41. 41Copyright © 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
  • 42. 42Copyright © 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~)