SlideShare a Scribd company logo
1 of 86
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Grant McAlister – Senior Principal Engineer – Amazon RDS
Oct 2018
HOT
UNDERSTANDING THIS IMPORTANT UPDATE OPTIMIZATION
What is HOT - Heap Only Tuples
The Heap Only Tuple (HOT) feature eliminates redundant index entries and
allows the re-use of space taken by DELETEd or obsoleted UPDATEd tuples
without performing a table-wide vacuum. It does this by allowing
single-page vacuuming, also called "defragmentation".
Full description - src/backend/access/heap/README.HOT
Regular Update
heap
1 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
Regular Update
heap
1 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
pageinspect – one row inserted
postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0));
lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid
-----------+----------+-------+-------+-------+---------+----------+---------+-----------
0/15E6380 | 0 | 0 | 28 | 8008 | 8192 | 8192 | 4 | 0
(1 row)
postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL'
when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin,
t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from
heap_page_items(get_raw_page('benchmark_uuid2', 0));
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+--------+--------+--------+--------------------------+-----------
1 | 8008 | LP_NORMAL | 184 | 1861 | 0 | (0,1) | XMAX_INVALID|HASVARWIDTH |
(1 row)
postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1);
itemoffset | ctid | itemlen | nulls | vars | data
------------+-------+---------+-------+------+-------------------------
1 | (0,1) | 16 | f | f | 04 00 00 00 00 00 00 00
(1 row)
pageinspect – regular update
postgres=# update benchmark_uuid2 set last_updated = now() where id=4;
UPDATE 1
postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0));
lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid
-----------+----------+-------+-------+-------+---------+----------+---------+-----------
0/15E67A8 | 0 | 0 | 32 | 7824 | 8192 | 8192 | 4 | 1862
(1 row)
postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when
lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax,
t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from
heap_page_items(get_raw_page('benchmark_uuid2', 0));
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+--------+--------+--------+----------------------------------+-----------
1 | 8008 | LP_NORMAL | 184 | 1861 | 1862 | (0,2) | XMIN_COMMITTED|HASVARWIDTH |
2 | 7824 | LP_NORMAL | 184 | 1862 | 0 | (0,2) | UPDATED|XMAX_INVALID|HASVARWIDTH |
(2 rows)
postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1);
itemoffset | ctid | itemlen | nulls | vars | data
------------+-------+---------+-------+------+-------------------------
1 | (0,2) | 16 | f | f | 04 00 00 00 00 00 00 00
2 | (0,1) | 16 | f | f | 04 00 00 00 00 00 00 00
(2 rows)
HOT Update
heap
1 lp
index
leaf
index A index B index C
tuple v1
block0 block1
HOT Update
heap
1 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple v2
HOT Update
heap
1 lp
index
leaf
index A index B index C
tuple v1
block0 block1
HOT Update
heap
1 lp
index
leaf
index A index B index C
tuple v1
block0 block1
HOT Update
heap
1 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
HOT Update
heap
1 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
HOT Update
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
HOT Update
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
HOT Update
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
HOT Update
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
HOT Update
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
pageinspect – first hot update
postgres=# update benchmark_uuid2 set e=cast(0 as boolean) where id = 5;
UPDATE 1
postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0));
lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid
-----------+----------+-------+-------+-------+---------+----------+---------+-----------
0/15EC1A0 | 0 | 0 | 32 | 7824 | 8192 | 8192 | 4 | 1865
(1 row)
postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when
lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax,
t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from
heap_page_items(get_raw_page('benchmark_uuid2', 0));
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+--------+--------+--------+----------------------------------+-----------------
1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED
2 | 7824 | LP_NORMAL | 184 | 1865 | 0 | (0,2) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_TUPLE
(2 rows)
postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1);
itemoffset | ctid | itemlen | nulls | vars | data
------------+-------+---------+-------+------+-------------------------
1 | (0,1) | 16 | f | f | 05 00 00 00 00 00 00 00
(1 row)
pageinspect – second hot update
postgres=# update benchmark_uuid2 set e=cast(1 as boolean) where id = 5;
UPDATE 1
postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0));
lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid
-----------+----------+-------+-------+-------+---------+----------+---------+-----------
0/15EC4C8 | 0 | 0 | 36 | 7640 | 8192 | 8192 | 4 | 1865
(1 row)
postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT'
when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2,
2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0));
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+--------+--------+--------+-------------------------------------------+-----------------------------
1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED
2 | 7824 | LP_NORMAL | 184 | 1865 | 1866 | (0,3) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE
3 | 7640 | LP_NORMAL | 184 | 1866 | 0 | (0,3) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_TUPLE
(3 rows)
postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1);
itemoffset | ctid | itemlen | nulls | vars | data
------------+-------+---------+-------+------+-------------------------
1 | (0,1) | 16 | f | f | 05 00 00 00 00 00 00 00
(1 row)
HOT Update - Pruning
heap
31 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
tuple v3
HOT Update - Pruning
heap
31 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
tuple v3
X
HOT Update - Pruning
heap
31 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
tuple v3
HOT Update - Pruning
heap
31 2 lp
index
leaf
index A index B index C
block0 block1
tuple v3
pageinspect – pruning (almost full page)
postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN
'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from
heap_page_items(get_raw_page('benchmark_uuid2', 0));
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+--------+--------+--------+---------------------------------------------------+-----------------------------
1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED
2 | 7824 | LP_NORMAL | 184 | 1865 | 1866 | (0,3) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
3 | 7640 | LP_NORMAL | 184 | 1866 | 1867 | (0,4) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
4 | 7456 | LP_NORMAL | 184 | 1867 | 1868 | (0,5) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
5 | 7272 | LP_NORMAL | 184 | 1868 | 1869 | (0,6) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
6 | 7088 | LP_NORMAL | 184 | 1869 | 1870 | (0,7) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE
7 | 6904 | LP_NORMAL | 184 | 1870 | 1871 | (0,8) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
8 | 6720 | LP_NORMAL | 184 | 1871 | 1872 | (0,9) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
9 | 6536 | LP_NORMAL | 184 | 1872 | 1873 | (0,10) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE
10 | 6352 | LP_NORMAL | 184 | 1873 | 1874 | (0,11) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
11 | 6168 | LP_NORMAL | 184 | 1874 | 1875 | (0,12) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
12 | 5984 | LP_NORMAL | 184 | 1875 | 1876 | (0,13) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
13 | 5800 | LP_NORMAL | 184 | 1876 | 1877 | (0,14) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE
...
28 | 3040 | LP_NORMAL | 184 | 1891 | 1892 | (0,29) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
29 | 2856 | LP_NORMAL | 184 | 1892 | 1893 | (0,30) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
30 | 2672 | LP_NORMAL | 184 | 1893 | 1894 | (0,31) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
31 | 2488 | LP_NORMAL | 184 | 1894 | 1895 | (0,32) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
32 | 2304 | LP_NORMAL | 184 | 1895 | 1896 | (0,33) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
33 | 2120 | LP_NORMAL | 184 | 1896 | 1897 | (0,34) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE
34 | 1936 | LP_NORMAL | 184 | 1897 | 0 | (0,34) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_T UPLE
(34 rows)
pageinspect – pruned
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-------------+--------+--------+--------+--------+---------------------------------------------------+-----------------------------
1 | 40 | LP_REDIRECT | 0 | | | | |
2 | 7824 | LP_NORMAL | 184 | 1904 | 1905 | (0,3) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE
3 | 7640 | LP_NORMAL | 184 | 1905 | 0 | (0,3) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_ TUPLE
4 | 0 | LP_UNUSED | 0 | | | | |
5 | 0 | LP_UNUSED | 0 | | | | |
6 | 0 | LP_UNUSED | 0 | | | | |
7 | 0 | LP_UNUSED | 0 | | | | |
8 | 0 | LP_UNUSED | 0 | | | | |
9 | 0 | LP_UNUSED | 0 | | | | |
10 | 0 | LP_UNUSED | 0 | | | | |
11 | 0 | LP_UNUSED | 0 | | | | |
12 | 0 | LP_UNUSED | 0 | | | | |
13 | 0 | LP_UNUSED | 0 | | | | |
...
28 | 0 | LP_UNUSED | 0 | | | | |
29 | 0 | LP_UNUSED | 0 | | | | |
30 | 0 | LP_UNUSED | 0 | | | | |
31 | 0 | LP_UNUSED | 0 | | | | |
32 | 0 | LP_UNUSED | 0 | | | | |
33 | 0 | LP_UNUSED | 0 | | | | |
34 | 0 | LP_UNUSED | 0 | | | | |
35 | 0 | LP_UNUSED | 0 | | | | |
36 | 0 | LP_UNUSED | 0 | | | | |
37 | 0 | LP_UNUSED | 0 | | | | |
38 | 0 | LP_UNUSED | 0 | | | | |
39 | 0 | LP_UNUSED | 0 | | | | |
40 | 8008 | LP_NORMAL | 184 | 1903 | 1904 | (0,2) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE
(40 rows)
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
block2
fillfactor=100 (default)
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple v2
block2
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
fillfactor=100 (default)
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple v2 tuple v3
block2
tuple
tuple
tuple
tuple
tuple
tuple
tuple
tuple
fillfactor=100 (default)
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
block2
fillfactor=90
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
block2
fillfactor=90
tuple v2
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
tuple
tuple
tuple
tuple
tuple
tuple
block2
tuple
tuple
tuple
tuple
tuple
tuple
tuple
fillfactor=90
tuple v2 tuple v3
tuple
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
block2
tuple
fillfactor=10
tuple
tuple
tuple
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
block2
tuple
fillfactor=10
tuple
tuple v2
tuple
tuple
Continuous inserts and update the same single tuple 100 times
Fillfactor
heap
tuple v1
block0 block1
tuple
block2
tuple
fillfactor=10
tuple
tuple v2
tuple v3
tuple
tuple
Continuous inserts and update the same single tuple 100 times
Fillfactor on Insert & Single Update Workload
Insert at 2K TPS and update one row 100 times while
having a long running transaction
Fillfactor Single Key Fetch Table Scan
100
90
50
10
101 blocks
18 blocks
5 blocks
3 blocks
5.5K blocks
6K blocks
11K blocks
60K blocks
Bloat comes
in many
disguises
Fillfactor on Insert & Single Update Workload
Insert at 2K TPS and update one row 100 times while
having a long running transaction
Fillfactor Single Key Fetch Table Scan
100
90
50
10
5.5K blocks
6K blocks
11K blocks
60K blocks
2 blocks
1 block
1 block Bloat comes
in many
disguises
Fillfactor on Insert & Single Update Workload
Insert at 2K TPS and update one row 100 times while
having a long running transaction
Fillfactor Single Key Fetch Table Scan
100
90
50
10
5.5K blocks
6K blocks
11K blocks
60K blocks
2 blocks
1 block
1 block
1 block
Bloat comes
in many
disguises
0
1,000
2,000
3,000
4,000
5,000
6,000
7,000
8,000
1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
SizeinKB
Minutes
Heap + One Index - Update Single Row
Regular Long Transaction Regular 1 Min Transaction
Regular No Transaction HOT Long Transaction
HOT 1 Min Transaction HOT No Transaction
0
100
200
300
400
500
600
700
800
900
1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
SizeinKB
Minutes
One Index - Update Single Row
Regular Long Transaction Regular 1 Min Transaction
Regular No Transaction Hot Long Transaction
Hot 1 Min Transaction Hot No Transaction
Measuring Longest Running Transaction
postgres=# select max(now() - xact_start ) from pg_stat_activity;
max
-----------------
02:02:48.021408
One the fly cleanup - HEAP
heap
1 2 lp
index
leaf
index A index B index C
tuple v1
block0 block1
tuple v2
One the fly cleanup - HEAP
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
One the fly cleanup - HEAP
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
On the fly Heap Tuple Pruning – Full Table
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+---------+---------+--------+---------------------------------------------------+-----------
1 | 7976 | LP_NORMAL | 216 | 3265456 | 3265457 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
2 | 7760 | LP_NORMAL | 216 | 3265457 | 3265458 | (0,3) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
3 | 7544 | LP_NORMAL | 216 | 3265458 | 3265459 | (0,4) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
4 | 7328 | LP_NORMAL | 216 | 3265459 | 3265460 | (0,5) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
5 | 7112 | LP_NORMAL | 216 | 3265460 | 3265461 | (0,6) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
6 | 6896 | LP_NORMAL | 216 | 3265461 | 3265462 | (0,7) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
7 | 6680 | LP_NORMAL | 216 | 3265462 | 3265463 | (0,8) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
8 | 6464 | LP_NORMAL | 216 | 3265463 | 3265464 | (0,9) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
9 | 6248 | LP_NORMAL | 216 | 3265464 | 3265465 | (0,10) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
10 | 6032 | LP_NORMAL | 216 | 3265465 | 3265466 | (0,11) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
11 | 5816 | LP_NORMAL | 216 | 3265466 | 3265467 | (0,12) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
12 | 5600 | LP_NORMAL | 216 | 3265467 | 3265468 | (0,13) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
13 | 5384 | LP_NORMAL | 216 | 3265468 | 3265469 | (0,14) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
14 | 5168 | LP_NORMAL | 216 | 3265469 | 3265470 | (0,15) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
15 | 4952 | LP_NORMAL | 216 | 3265470 | 3265471 | (0,16) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
16 | 4736 | LP_NORMAL | 216 | 3265471 | 3265472 | (0,17) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
17 | 4520 | LP_NORMAL | 216 | 3265472 | 3265473 | (0,18) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH |
18 | 4304 | LP_NORMAL | 216 | 3265473 | 3265474 | (0,19) | UPDATED|XMIN_COMMITTED|HASVARWIDTH |
19 | 4088 | LP_NORMAL | 216 | 3265474 | 0 | (0,19) | UPDATED|XMAX_INVALID|HASVARWIDTH |
(19 rows)
On the fly Heap Tuple Pruning – Pruned Table
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
----+--------+-----------+--------+---------+---------+--------+------------------------------------+-----------
1 | 0 | LP_DEAD | 0 | | | | |
2 | 0 | LP_DEAD | 0 | | | | |
3 | 0 | LP_DEAD | 0 | | | | |
4 | 0 | LP_DEAD | 0 | | | | |
5 | 0 | LP_DEAD | 0 | | | | |
6 | 0 | LP_DEAD | 0 | | | | |
7 | 0 | LP_DEAD | 0 | | | | |
8 | 0 | LP_DEAD | 0 | | | | |
9 | 0 | LP_DEAD | 0 | | | | |
10 | 0 | LP_DEAD | 0 | | | | |
11 | 0 | LP_DEAD | 0 | | | | |
12 | 0 | LP_DEAD | 0 | | | | |
13 | 0 | LP_DEAD | 0 | | | | |
14 | 0 | LP_DEAD | 0 | | | | |
15 | 0 | LP_DEAD | 0 | | | | |
16 | 0 | LP_DEAD | 0 | | | | |
17 | 0 | LP_DEAD | 0 | | | | |
18 | 0 | LP_DEAD | 0 | | | | |
19 | 7976 | LP_NORMAL | 216 | 3265474 | 3265475 | (0,20) | UPDATED|XMIN_COMMITTED|HASVARWIDTH |
20 | 7760 | LP_NORMAL | 216 | 3265475 | 0 | (0,20) | UPDATED|XMAX_INVALID|HASVARWIDTH |
(20 rows)
On the fly Heap Tuple Pruning – Index Not!
itemoffset | ctid | itemlen | nulls | vars | data
------------+--------+---------+-------+------+-------------------------
1 | (0,20) | 16 | f | f | b7 ab 03 00 00 00 00 00
2 | (0,19) | 16 | f | f | b7 ab 03 00 00 00 00 00
3 | (0,18) | 16 | f | f | b7 ab 03 00 00 00 00 00
4 | (0,17) | 16 | f | f | b7 ab 03 00 00 00 00 00
5 | (0,16) | 16 | f | f | b7 ab 03 00 00 00 00 00
6 | (0,15) | 16 | f | f | b7 ab 03 00 00 00 00 00
7 | (0,14) | 16 | f | f | b7 ab 03 00 00 00 00 00
8 | (0,13) | 16 | f | f | b7 ab 03 00 00 00 00 00
9 | (0,12) | 16 | f | f | b7 ab 03 00 00 00 00 00
10 | (0,11) | 16 | f | f | b7 ab 03 00 00 00 00 00
11 | (0,10) | 16 | f | f | b7 ab 03 00 00 00 00 00
12 | (0,9) | 16 | f | f | b7 ab 03 00 00 00 00 00
13 | (0,8) | 16 | f | f | b7 ab 03 00 00 00 00 00
14 | (0,7) | 16 | f | f | b7 ab 03 00 00 00 00 00
15 | (0,6) | 16 | f | f | b7 ab 03 00 00 00 00 00
16 | (0,5) | 16 | f | f | b7 ab 03 00 00 00 00 00
17 | (0,4) | 16 | f | f | b7 ab 03 00 00 00 00 00
18 | (0,3) | 16 | f | f | b7 ab 03 00 00 00 00 00
19 | (0,2) | 16 | f | f | b7 ab 03 00 00 00 00 00
20 | (0,1) | 16 | f | f | b7 ab 03 00 00 00 00 00
(20 rows)
One the fly cleanup - Index
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
One the fly cleanup - Index
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
tuple v2
Index on fly cleanup – almost full page
itemoffset | ctid | itemlen | nulls | vars | data
------------+---------+---------+-------+------+-------------------------
1 | (1,116) | 16 | f | f | b5 ab 03 00 00 00 00 00
2 | (1,115) | 16 | f | f | b5 ab 03 00 00 00 00 00
3 | (1,114) | 16 | f | f | b5 ab 03 00 00 00 00 00
4 | (1,113) | 16 | f | f | b5 ab 03 00 00 00 00 00
5 | (1,112) | 16 | f | f | b5 ab 03 00 00 00 00 00
6 | (1,111) | 16 | f | f | b5 ab 03 00 00 00 00 00
7 | (1,110) | 16 | f | f | b5 ab 03 00 00 00 00 00
8 | (1,109) | 16 | f | f | b5 ab 03 00 00 00 00 00
9 | (1,108) | 16 | f | f | b5 ab 03 00 00 00 00 00
10 | (1,107) | 16 | f | f | b5 ab 03 00 00 00 00 00
11 | (1,106) | 16 | f | f | b5 ab 03 00 00 00 00 00
12 | (1,105) | 16 | f | f | b5 ab 03 00 00 00 00 00
…
397 | (0,11) | 16 | f | f | b5 ab 03 00 00 00 00 00
398 | (0,10) | 16 | f | f | b5 ab 03 00 00 00 00 00
399 | (0,9) | 16 | f | f | b5 ab 03 00 00 00 00 00
400 | (0,8) | 16 | f | f | b5 ab 03 00 00 00 00 00
401 | (0,7) | 16 | f | f | b5 ab 03 00 00 00 00 00
402 | (0,6) | 16 | f | f | b5 ab 03 00 00 00 00 00
403 | (0,5) | 16 | f | f | b5 ab 03 00 00 00 00 00
404 | (0,4) | 16 | f | f | b5 ab 03 00 00 00 00 00
405 | (0,3) | 16 | f | f | b5 ab 03 00 00 00 00 00
406 | (0,2) | 16 | f | f | b5 ab 03 00 00 00 00 00
407 | (0,1) | 16 | f | f | b5 ab 03 00 00 00 00 00
(407 rows)
Index on fly cleanup – cleaned up
itemoffset | ctid | itemlen | nulls | vars | data
------------+---------+---------+-------+------+-------------------------
1 | (1,117) | 16 | f | f | b5 ab 03 00 00 00 00 00
2 | (1,116) | 16 | f | f | b5 ab 03 00 00 00 00 00
(2 rows)
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Scan to
find id’s
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum
heap
1 2 lp
index
leaf
index A index B index C
block0 block1
Vacuum Block Cleanup – Lots of DEAD LP’s
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
-----+--------+----------+--------+--------+--------+--------+----------+-----------
1 | 0 | LP_DEAD | 0 | | | | |
2 | 0 | LP_DEAD | 0 | | | | |
3 | 0 | LP_DEAD | 0 | | | | |
4 | 0 | LP_DEAD | 0 | | | | |
5 | 0 | LP_DEAD | 0 | | | | |
6 | 0 | LP_DEAD | 0 | | | | |
7 | 0 | LP_DEAD | 0 | | | | |
8 | 0 | LP_DEAD | 0 | | | | |
9 | 0 | LP_DEAD | 0 | | | | |
10 | 0 | LP_DEAD | 0 | | | | |
...
281 | 0 | LP_DEAD | 0 | | | | |
282 | 0 | LP_DEAD | 0 | | | | |
283 | 0 | LP_DEAD | 0 | | | | |
284 | 0 | LP_DEAD | 0 | | | | |
285 | 0 | LP_DEAD | 0 | | | | |
286 | 0 | LP_DEAD | 0 | | | | |
287 | 0 | LP_DEAD | 0 | | | | |
288 | 0 | LP_DEAD | 0 | | | | |
289 | 0 | LP_DEAD | 0 | | | | |
290 | 0 | LP_DEAD | 0 | | | | |
291 | 0 | LP_DEAD | 0 | | | | |
(291 rows)
Vacuum Block Cleanup – Unused LP’s
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2
-----+--------+-----------+--------+--------+--------+--------+----------+-----------
1 | 0 | LP_UNUSED | 0 | | | | |
2 | 0 | LP_UNUSED | 0 | | | | |
3 | 0 | LP_UNUSED | 0 | | | | |
4 | 0 | LP_UNUSED | 0 | | | | |
5 | 0 | LP_UNUSED | 0 | | | | |
6 | 0 | LP_UNUSED | 0 | | | | |
7 | 0 | LP_UNUSED | 0 | | | | |
8 | 0 | LP_UNUSED | 0 | | | | |
9 | 0 | LP_UNUSED | 0 | | | | |
10 | 0 | LP_UNUSED | 0 | | | | |
...
281 | 0 | LP_UNUSED | 0 | | | | |
282 | 0 | LP_UNUSED | 0 | | | | |
283 | 0 | LP_UNUSED | 0 | | | | |
284 | 0 | LP_UNUSED | 0 | | | | |
285 | 0 | LP_UNUSED | 0 | | | | |
286 | 0 | LP_UNUSED | 0 | | | | |
287 | 0 | LP_UNUSED | 0 | | | | |
288 | 0 | LP_UNUSED | 0 | | | | |
289 | 0 | LP_UNUSED | 0 | | | | |
290 | 0 | LP_UNUSED | 0 | | | | |
291 | 0 | LP_UNUSED | 0 | | | | |
(291 rows)
Is that an update? ORM cases
ORM and other software sometimes update all columns in table including all indexed columns
UPDATE to NEW VALUE
postgres=# update benchmark_uuid2 set last_updated = now() where id=2;
UPDATE 1
postgres=# select n_tup_upd, n_tup_hot_upd from pg_stat_all_tables where relname = 'benchmark_uuid2';
n_tup_upd | n_tup_hot_upd
-----------+---------------
1 | 0
UPDATE to SAME VALUE (i.e. ORM case)
postgres=# update benchmark_uuid2 set last_updated = ( select last_updated benchmark_uuid2 where id=2)
where id=2;
UPDATE 1
postgres=# select n_tup_upd, n_tup_hot_upd from pg_stat_all_tables where relname = 'benchmark_uuid2';
n_tup_upd | n_tup_hot_upd
-----------+---------------
2 | 1
(1 row)
!=
Index Tests – A table with 2 to 64 indexes
Create the table with a PK, 64 Random int Columns and 1 last updated timestamp
create table benchmark_serial (
pk serial constraint pk_benchmark_serial_pk PRIMARY KEY,
a1 int not null,
…..
a64 int not null,
last_updated timestamp
);
Create between 2 and 64 indexes on the random int columns
create index i_benchmark_serial_a1 on benchmark_serial (a1);
….
create index i_benchmark_serial_a64 on benchmark_serial (a64);
For the Regular Test
create index i_benchmark_serial_lu on benchmark_serial (last_updated);
Full Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Full
Block
WAL
Full Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Full
Block
WAL
Full Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Checkpoint
Datafile
Full
Block
WAL
Archive
Full Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Checkpoint
Datafile
Full
Block
WAL
Archive
4K
4K
8K
Full Page Writes
Block in
Memory
PostgreSQL
update t set y = 6;
Checkpoint
Datafile
Full
Block
WAL
Archive
4K
4K
8K
During crash
recovery
PostgreSQL
uses the FPW
block in the
WAL to replace
the bad
checkpointed
block
1-
200
1-
100
101-
200
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert a Sequence Number into a B-tree
1-
200
1-
100
101-
200
Insert 201
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
1-
201
101-
201
151-
201
176-
201
4 blocks
loaded
Insert a Sequence Number into a B-tree
1-
200
1-
100
101-
200
Insert 201
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert 202
1-
201
101-
201
151-
201
176-
201
1-
202
101-
202
151-
202
176-
202
4 blocks
loaded
Insert a Sequence Number into a B-tree
0 blocks
loaded
1-
200
1-
100
101-
200
Insert 201
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert 202
1-
201
101-
201
151-
201
176-
201
1-
202
101-
202
151-
202
176-
202
4 blocks
loaded
Insert a Sequence Number into a B-tree
0 blocks
loaded
At least 1 FPW
1-
200
1-
100
101-
200
Insert
124
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
1-
200
101-
200
101-
150
101-
125
4 blocks
loaded
Insert a Random value into a B-tree
1-
200
1-
100
101-
200
Insert
124
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert 99
1-
200
101-
200
101-
150
101-
125
4 blocks
loaded
1-
100
51-
100
76-
100
3 blocks
loaded
Insert a Random value into a B-tree
1-
200
1-
100
101-
200
Insert
124
1-50
51-
100
1-25
26-
50
51-
75
76-
100
101-
150
151-
200
101-
125
126-
150
151-
175
176-
200
Insert 99
1-
200
101-
200
101-
150
101-
125
4 blocks
loaded
1-
100
51-
100
76-
100
3 blocks
loaded
Insert a Random value into a B-tree
151-
200
151-
200
2 blocks
loaded
Insert 161
At least 3 FPW
HOT Updates – Looking at FPW in the logs
HOT Updated
Heap 14/ 68, , d: HOT_UPDATE off 19 xmax 2327993188 ; new off 3 xmax 0, blkref #0: rel 1663/41083/41086 blk 28
XLOG 0/ 3368, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41092 blk 1492899 FPW
Transaction 8/ 34, , d: COMMIT 2017-09-07 00:07:17.532647 UTC
Non HOT Update
Heap 14/ 75, , d: UPDATE off 67 xmax 2327993195 ; new off 7 xmax 0, blkref #0: rel 1663/41083/41086 blk 285
XLOG 0/ 2774, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41090 blk 7039952 FPW
Btree 2/ 120, , d: INSERT_LEAF off 17, blkref #0: rel 1663/41083/41090 blk 7039952
XLOG 0/ 3150, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41092 blk 29 FPW
Btree 2/ 64, , d: INSERT_LEAF off 205, blkref #0: rel 1663/41083/41092 blk 29
Btree 2/ 2639, , d: INSERT_LEAF off 73, blkref #0: rel 1663/41083/41093 blk 4 FPW
Btree 2/ 3148, , d: INSERT_LEAF off 2, blkref #0: rel 1663/41083/41094 blk 1 FPW
Btree 2/ 5099, , d: INSERT_LEAF off 364, blkref #0: rel 1663/41083/41095 blk 4237904 FPW
Transaction 8/ 34, , d: COMMIT 2017-09-07 00:24:29.427017 UTC
3.4K VS 16.7K
-
5,000
10,000
15,000
20,000
25,000
30,000
35,000
40,000
45,000
2 4 8 16 32 64
TransactionsPerSecond(TPS)
Number of Indexes
Updates with 100 Clients
HOT Regular
35X
Index Tests – Vacuuming
benchdb=> vacuum verbose benchmark_serial;
INFO: vacuuming "public.benchmark_serial"
INFO: scanned index "pk_benchmark_serial_pk" to remove 1939503 row versions
DETAIL: CPU 0.05s/4.93u sec elapsed 5.52 sec
INFO: scanned index "i_benchmark_serial_a1" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.52u sec elapsed 9.67 sec
INFO: scanned index "i_benchmark_serial_a2" to remove 1939503 row versions
DETAIL: CPU 0.02s/9.26u sec elapsed 9.43 sec
INFO: scanned index "i_benchmark_serial_a3" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.22u sec elapsed 9.49 sec
INFO: scanned index "i_benchmark_serial_a4" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.05u sec elapsed 9.23 sec
INFO: scanned index "i_benchmark_serial_a5" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.13u sec elapsed 9.44 sec
INFO: scanned index "i_benchmark_serial_a6" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.21u sec elapsed 9.37 sec
INFO: scanned index "i_benchmark_serial_a7" to remove 1939503 row versions
DETAIL: CPU 0.01s/9.18u sec elapsed 9.57 sec
INFO: scanned index "i_benchmark_serial_a8" to remove 1939503 row versions
DETAIL: CPU 0.00s/9.22u sec elapsed 9.49 sec
INFO: scanned index "i_benchmark_serial_a9" to remove 1939503 row versions
…..
DETAIL: CPU 0.02s/9.03u sec elapsed 9.56 sec
INFO: scanned index "i_benchmark_serial_a16" to remove 1939503 row versions
…..
0
100
200
300
400
500
600
700
2 4 8 16 32 64
Seconds
Number of Indexes
Vacuum Time per 1M Updates
HOT Regular
101X
Example – Keep track of table changes
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 7 19-OCT-2009
4 A A1 MFM USEFUL 2 21-OCT-1972
Example – Keep track of table changes
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 7 19-OCT-2009
4 A A1 MFM USEFUL 2 21-OCT-1972
Data Lake
Example – Keep track of table changes
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 7 19-OCT-2009
4 A A1 MFM USEFUL 2 21-OCT-1972
Data Lake Full
Table
Scan
Example – Build an index on Last Updated
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 8 15-OCT-2018
4 A A1 MFM USEFUL 2 21-OCT-1972
Data Lake Index
Scan
Example – Build an index on Last Updated
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 8 15-OCT-2018
4 A A1 MFM USEFUL 2 21-OCT-1972
Data Lake Index
Scan
Before: Updates to C1,C3,C4, Last Updated are HOT
After: Every update is a regular update
Example – Logical Replication
PK C1 C2 C3 C4 C4 Last Updated
1 X A1 FOO HOT 9 01-Jun-1999
2 Y A2 BAR IS 9 01-Jul-2001
3 Z A2 RLL REALLY 7 19-OCT-2009
4 A A1 MFM USEFUL 2 21-OCT-1972
All changes
WAL logged
WAL
Logical
Decoding
and
Replication
Data Lake
Thank you!
Questions?

More Related Content

What's hot

Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTanel Poder
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Grant McAlister
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsAlexander Korotkov
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyAlexander Kukushkin
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
PGroonga – Make PostgreSQL fast full text search platform for all languages!
PGroonga – Make PostgreSQL fast full text search platform for all languages!PGroonga – Make PostgreSQL fast full text search platform for all languages!
PGroonga – Make PostgreSQL fast full text search platform for all languages!Kouhei Sutou
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Grant McAlister
 
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detailMIJIN AN
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
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
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015PostgreSQL-Consulting
 
Wait! What’s going on inside my database?
Wait! What’s going on inside my database?Wait! What’s going on inside my database?
Wait! What’s going on inside my database?Jeremy Schneider
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
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
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBrendan Gregg
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningMongoDB
 
Practical Memory Tuning for PostgreSQL
Practical Memory Tuning for PostgreSQLPractical Memory Tuning for PostgreSQL
Practical Memory Tuning for PostgreSQLGrant McAlister
 

What's hot (20)

Vacuum徹底解説
Vacuum徹底解説Vacuum徹底解説
Vacuum徹底解説
 
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
PGroonga – Make PostgreSQL fast full text search platform for all languages!
PGroonga – Make PostgreSQL fast full text search platform for all languages!PGroonga – Make PostgreSQL fast full text search platform for all languages!
PGroonga – Make PostgreSQL fast full text search platform for all languages!
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput
 
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
統計情報のリセットによるautovacuumへの影響について(第39回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
Wait! What’s going on inside my database?
Wait! What’s going on inside my database?Wait! What’s going on inside my database?
Wait! What’s going on inside my database?
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
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...
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
Practical Memory Tuning for PostgreSQL
Practical Memory Tuning for PostgreSQLPractical Memory Tuning for PostgreSQL
Practical Memory Tuning for PostgreSQL
 

Similar to HOT Understanding this important update optimization

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介Akira Maruoka
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatFranck Pachot
 
ANALYZE for Statements - MariaDB's hidden gem
ANALYZE for Statements - MariaDB's hidden gemANALYZE for Statements - MariaDB's hidden gem
ANALYZE for Statements - MariaDB's hidden gemSergey Petrunya
 
Adapting to Adaptive Plans on 12c
Adapting to Adaptive Plans on 12cAdapting to Adaptive Plans on 12c
Adapting to Adaptive Plans on 12cMauro Pagano
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
Analytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hiveAnalytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hiveAnkit Beohar
 
Cardinality and the Optimizer
Cardinality and the OptimizerCardinality and the Optimizer
Cardinality and the OptimizerConnor McDonald
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemJay Corrales
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
 
codecentric AG: Using Cassandra and Clojure for Data Crunching backends
codecentric AG: Using Cassandra and Clojure for Data Crunching backendscodecentric AG: Using Cassandra and Clojure for Data Crunching backends
codecentric AG: Using Cassandra and Clojure for Data Crunching backendsDataStax Academy
 

Similar to HOT Understanding this important update optimization (20)

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Pro PostgreSQL
Pro PostgreSQLPro PostgreSQL
Pro PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
ANALYZE for Statements - MariaDB's hidden gem
ANALYZE for Statements - MariaDB's hidden gemANALYZE for Statements - MariaDB's hidden gem
ANALYZE for Statements - MariaDB's hidden gem
 
Adapting to Adaptive Plans on 12c
Adapting to Adaptive Plans on 12cAdapting to Adaptive Plans on 12c
Adapting to Adaptive Plans on 12c
 
Rpd
RpdRpd
Rpd
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
Analytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hiveAnalytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hive
 
Cardinality and the Optimizer
Cardinality and the OptimizerCardinality and the Optimizer
Cardinality and the Optimizer
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
How To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification SystemHow To Crack RSA Netrek Binary Verification System
How To Crack RSA Netrek Binary Verification System
 
Mysql 4.0 casual
Mysql 4.0 casualMysql 4.0 casual
Mysql 4.0 casual
 
C PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAMC PROGRAMS - SARASWATHI RAMALINGAM
C PROGRAMS - SARASWATHI RAMALINGAM
 
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 
Boosting Developer Productivity with Clang
Boosting Developer Productivity with ClangBoosting Developer Productivity with Clang
Boosting Developer Productivity with Clang
 
codecentric AG: Using Cassandra and Clojure for Data Crunching backends
codecentric AG: Using Cassandra and Clojure for Data Crunching backendscodecentric AG: Using Cassandra and Clojure for Data Crunching backends
codecentric AG: Using Cassandra and Clojure for Data Crunching backends
 
Esd module2
Esd module2Esd module2
Esd module2
 

More from Grant McAlister

re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovationsGrant McAlister
 
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...Grant McAlister
 
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibilityre:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL CompatibilityGrant McAlister
 
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQL
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQLAWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQL
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQLGrant McAlister
 
Dat305 Deep Dive on Amazon Aurora PostgreSQL
Dat305 Deep Dive on Amazon Aurora PostgreSQLDat305 Deep Dive on Amazon Aurora PostgreSQL
Dat305 Deep Dive on Amazon Aurora PostgreSQLGrant McAlister
 
DAT402 - Deep Dive on Amazon Aurora PostgreSQL
DAT402 - Deep Dive on Amazon Aurora PostgreSQL DAT402 - Deep Dive on Amazon Aurora PostgreSQL
DAT402 - Deep Dive on Amazon Aurora PostgreSQL Grant McAlister
 
Deep dive into the Rds PostgreSQL Universe Austin 2017
Deep dive into the Rds PostgreSQL Universe Austin 2017Deep dive into the Rds PostgreSQL Universe Austin 2017
Deep dive into the Rds PostgreSQL Universe Austin 2017Grant McAlister
 
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017Grant McAlister
 
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...Grant McAlister
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Grant McAlister
 

More from Grant McAlister (10)

re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
 
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...
re:Invent 2022 DAT316 Build resilient applications using Amazon RDS and Auror...
 
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibilityre:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
 
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQL
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQLAWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQL
AWS re:Invent 2019 - DAT328 Deep Dive on Amazon Aurora PostgreSQL
 
Dat305 Deep Dive on Amazon Aurora PostgreSQL
Dat305 Deep Dive on Amazon Aurora PostgreSQLDat305 Deep Dive on Amazon Aurora PostgreSQL
Dat305 Deep Dive on Amazon Aurora PostgreSQL
 
DAT402 - Deep Dive on Amazon Aurora PostgreSQL
DAT402 - Deep Dive on Amazon Aurora PostgreSQL DAT402 - Deep Dive on Amazon Aurora PostgreSQL
DAT402 - Deep Dive on Amazon Aurora PostgreSQL
 
Deep dive into the Rds PostgreSQL Universe Austin 2017
Deep dive into the Rds PostgreSQL Universe Austin 2017Deep dive into the Rds PostgreSQL Universe Austin 2017
Deep dive into the Rds PostgreSQL Universe Austin 2017
 
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
 
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016
 

Recently uploaded

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...soniya singh
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 

Recently uploaded (20)

Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
High Class Call Girls Noida Sector 39 Aarushi 🔝8264348440🔝 Independent Escort...
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 

HOT Understanding this important update optimization

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Grant McAlister – Senior Principal Engineer – Amazon RDS Oct 2018 HOT UNDERSTANDING THIS IMPORTANT UPDATE OPTIMIZATION
  • 2. What is HOT - Heap Only Tuples The Heap Only Tuple (HOT) feature eliminates redundant index entries and allows the re-use of space taken by DELETEd or obsoleted UPDATEd tuples without performing a table-wide vacuum. It does this by allowing single-page vacuuming, also called "defragmentation". Full description - src/backend/access/heap/README.HOT
  • 3. Regular Update heap 1 2 lp index leaf index A index B index C tuple v1 block0 block1
  • 4. Regular Update heap 1 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2
  • 5. pageinspect – one row inserted postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0)); lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid -----------+----------+-------+-------+-------+---------+----------+---------+----------- 0/15E6380 | 0 | 0 | 28 | 8008 | 8192 | 8192 | 4 | 0 (1 row) postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+--------+--------+--------+--------------------------+----------- 1 | 8008 | LP_NORMAL | 184 | 1861 | 0 | (0,1) | XMAX_INVALID|HASVARWIDTH | (1 row) postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1); itemoffset | ctid | itemlen | nulls | vars | data ------------+-------+---------+-------+------+------------------------- 1 | (0,1) | 16 | f | f | 04 00 00 00 00 00 00 00 (1 row)
  • 6. pageinspect – regular update postgres=# update benchmark_uuid2 set last_updated = now() where id=4; UPDATE 1 postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0)); lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid -----------+----------+-------+-------+-------+---------+----------+---------+----------- 0/15E67A8 | 0 | 0 | 32 | 7824 | 8192 | 8192 | 4 | 1862 (1 row) postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+--------+--------+--------+----------------------------------+----------- 1 | 8008 | LP_NORMAL | 184 | 1861 | 1862 | (0,2) | XMIN_COMMITTED|HASVARWIDTH | 2 | 7824 | LP_NORMAL | 184 | 1862 | 0 | (0,2) | UPDATED|XMAX_INVALID|HASVARWIDTH | (2 rows) postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1); itemoffset | ctid | itemlen | nulls | vars | data ------------+-------+---------+-------+------+------------------------- 1 | (0,2) | 16 | f | f | 04 00 00 00 00 00 00 00 2 | (0,1) | 16 | f | f | 04 00 00 00 00 00 00 00 (2 rows)
  • 7. HOT Update heap 1 lp index leaf index A index B index C tuple v1 block0 block1
  • 8. HOT Update heap 1 lp index leaf index A index B index C tuple v1 block0 block1 tuple tuple tuple tuple tuple tuple tuple tuple tuple v2
  • 9. HOT Update heap 1 lp index leaf index A index B index C tuple v1 block0 block1
  • 10. HOT Update heap 1 lp index leaf index A index B index C tuple v1 block0 block1
  • 11. HOT Update heap 1 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2
  • 12. HOT Update heap 1 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2
  • 13. HOT Update heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 14. HOT Update heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 15. HOT Update heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 16. HOT Update heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 17. HOT Update heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 18. pageinspect – first hot update postgres=# update benchmark_uuid2 set e=cast(0 as boolean) where id = 5; UPDATE 1 postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0)); lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid -----------+----------+-------+-------+-------+---------+----------+---------+----------- 0/15EC1A0 | 0 | 0 | 32 | 7824 | 8192 | 8192 | 4 | 1865 (1 row) postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+--------+--------+--------+----------------------------------+----------------- 1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED 2 | 7824 | LP_NORMAL | 184 | 1865 | 0 | (0,2) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_TUPLE (2 rows) postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1); itemoffset | ctid | itemlen | nulls | vars | data ------------+-------+---------+-------+------+------------------------- 1 | (0,1) | 16 | f | f | 05 00 00 00 00 00 00 00 (1 row)
  • 19. pageinspect – second hot update postgres=# update benchmark_uuid2 set e=cast(1 as boolean) where id = 5; UPDATE 1 postgres=# SELECT * FROM page_header(get_raw_page('benchmark_uuid2',0)); lsn | checksum | flags | lower | upper | special | pagesize | version | prune_xid -----------+----------+-------+-------+-------+---------+----------+---------+----------- 0/15EC4C8 | 0 | 0 | 36 | 7640 | 8192 | 8192 | 4 | 1865 (1 row) postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+--------+--------+--------+-------------------------------------------+----------------------------- 1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED 2 | 7824 | LP_NORMAL | 184 | 1865 | 1866 | (0,3) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE 3 | 7640 | LP_NORMAL | 184 | 1866 | 0 | (0,3) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_TUPLE (3 rows) postgres=# SELECT * FROM bt_page_items('i_benchmark_uuid2_id', 1); itemoffset | ctid | itemlen | nulls | vars | data ------------+-------+---------+-------+------+------------------------- 1 | (0,1) | 16 | f | f | 05 00 00 00 00 00 00 00 (1 row)
  • 20. HOT Update - Pruning heap 31 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2 tuple v3
  • 21. HOT Update - Pruning heap 31 2 lp index leaf index A index B index C block0 block1 tuple v2 tuple v3 X
  • 22. HOT Update - Pruning heap 31 2 lp index leaf index A index B index C block0 block1 tuple v2 tuple v3
  • 23. HOT Update - Pruning heap 31 2 lp index leaf index A index B index C block0 block1 tuple v3
  • 24. pageinspect – pruning (almost full page) postgres=# select lp, lp_off, case when lp_flags = 0 THEN 'LP_UNUSED' when lp_flags=1 THEN 'LP_NORMAL' when lp_flags=2 THEN 'LP_REDIRECT' when lp_flags=3 THEN 'LP_DEAD' END as lp_flags, lp_len, t_xmin, t_xmax, t_ctid,infomask(t_infomask, 1) as infomask,infomask(t_infomask2, 2) as infomask2 from heap_page_items(get_raw_page('benchmark_uuid2', 0)); lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+--------+--------+--------+---------------------------------------------------+----------------------------- 1 | 8008 | LP_NORMAL | 184 | 1864 | 1865 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED 2 | 7824 | LP_NORMAL | 184 | 1865 | 1866 | (0,3) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 3 | 7640 | LP_NORMAL | 184 | 1866 | 1867 | (0,4) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 4 | 7456 | LP_NORMAL | 184 | 1867 | 1868 | (0,5) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 5 | 7272 | LP_NORMAL | 184 | 1868 | 1869 | (0,6) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 6 | 7088 | LP_NORMAL | 184 | 1869 | 1870 | (0,7) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE 7 | 6904 | LP_NORMAL | 184 | 1870 | 1871 | (0,8) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 8 | 6720 | LP_NORMAL | 184 | 1871 | 1872 | (0,9) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 9 | 6536 | LP_NORMAL | 184 | 1872 | 1873 | (0,10) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED| HEAP_ONLY_TUPLE 10 | 6352 | LP_NORMAL | 184 | 1873 | 1874 | (0,11) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 11 | 6168 | LP_NORMAL | 184 | 1874 | 1875 | (0,12) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 12 | 5984 | LP_NORMAL | 184 | 1875 | 1876 | (0,13) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 13 | 5800 | LP_NORMAL | 184 | 1876 | 1877 | (0,14) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE ... 28 | 3040 | LP_NORMAL | 184 | 1891 | 1892 | (0,29) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 29 | 2856 | LP_NORMAL | 184 | 1892 | 1893 | (0,30) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 30 | 2672 | LP_NORMAL | 184 | 1893 | 1894 | (0,31) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 31 | 2488 | LP_NORMAL | 184 | 1894 | 1895 | (0,32) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 32 | 2304 | LP_NORMAL | 184 | 1895 | 1896 | (0,33) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 33 | 2120 | LP_NORMAL | 184 | 1896 | 1897 | (0,34) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED |HEAP_ONLY_TUPLE 34 | 1936 | LP_NORMAL | 184 | 1897 | 0 | (0,34) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_T UPLE (34 rows)
  • 25. pageinspect – pruned lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-------------+--------+--------+--------+--------+---------------------------------------------------+----------------------------- 1 | 40 | LP_REDIRECT | 0 | | | | | 2 | 7824 | LP_NORMAL | 184 | 1904 | 1905 | (0,3) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE 3 | 7640 | LP_NORMAL | 184 | 1905 | 0 | (0,3) | UPDATED|XMAX_INVALID|HASVARWIDTH | HEAP_ONLY_ TUPLE 4 | 0 | LP_UNUSED | 0 | | | | | 5 | 0 | LP_UNUSED | 0 | | | | | 6 | 0 | LP_UNUSED | 0 | | | | | 7 | 0 | LP_UNUSED | 0 | | | | | 8 | 0 | LP_UNUSED | 0 | | | | | 9 | 0 | LP_UNUSED | 0 | | | | | 10 | 0 | LP_UNUSED | 0 | | | | | 11 | 0 | LP_UNUSED | 0 | | | | | 12 | 0 | LP_UNUSED | 0 | | | | | 13 | 0 | LP_UNUSED | 0 | | | | | ... 28 | 0 | LP_UNUSED | 0 | | | | | 29 | 0 | LP_UNUSED | 0 | | | | | 30 | 0 | LP_UNUSED | 0 | | | | | 31 | 0 | LP_UNUSED | 0 | | | | | 32 | 0 | LP_UNUSED | 0 | | | | | 33 | 0 | LP_UNUSED | 0 | | | | | 34 | 0 | LP_UNUSED | 0 | | | | | 35 | 0 | LP_UNUSED | 0 | | | | | 36 | 0 | LP_UNUSED | 0 | | | | | 37 | 0 | LP_UNUSED | 0 | | | | | 38 | 0 | LP_UNUSED | 0 | | | | | 39 | 0 | LP_UNUSED | 0 | | | | | 40 | 8008 | LP_NORMAL | 184 | 1903 | 1904 | (0,2) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | HOT_UPDATED|HEAP_ONLY_TUPLE (40 rows)
  • 26. Fillfactor heap tuple v1 block0 block1 tuple tuple tuple tuple tuple tuple tuple tuple block2 fillfactor=100 (default) Continuous inserts and update the same single tuple 100 times
  • 27. Fillfactor heap tuple v1 block0 block1 tuple tuple tuple tuple tuple tuple tuple tuple tuple v2 block2 tuple tuple tuple tuple tuple tuple tuple tuple fillfactor=100 (default) Continuous inserts and update the same single tuple 100 times
  • 28. Fillfactor heap tuple v1 block0 block1 tuple tuple tuple tuple tuple tuple tuple tuple tuple v2 tuple v3 block2 tuple tuple tuple tuple tuple tuple tuple tuple fillfactor=100 (default) Continuous inserts and update the same single tuple 100 times
  • 33. Fillfactor heap tuple v1 block0 block1 tuple block2 tuple fillfactor=10 tuple tuple v2 tuple tuple Continuous inserts and update the same single tuple 100 times
  • 34. Fillfactor heap tuple v1 block0 block1 tuple block2 tuple fillfactor=10 tuple tuple v2 tuple v3 tuple tuple Continuous inserts and update the same single tuple 100 times
  • 35. Fillfactor on Insert & Single Update Workload Insert at 2K TPS and update one row 100 times while having a long running transaction Fillfactor Single Key Fetch Table Scan 100 90 50 10 101 blocks 18 blocks 5 blocks 3 blocks 5.5K blocks 6K blocks 11K blocks 60K blocks Bloat comes in many disguises
  • 36. Fillfactor on Insert & Single Update Workload Insert at 2K TPS and update one row 100 times while having a long running transaction Fillfactor Single Key Fetch Table Scan 100 90 50 10 5.5K blocks 6K blocks 11K blocks 60K blocks 2 blocks 1 block 1 block Bloat comes in many disguises
  • 37. Fillfactor on Insert & Single Update Workload Insert at 2K TPS and update one row 100 times while having a long running transaction Fillfactor Single Key Fetch Table Scan 100 90 50 10 5.5K blocks 6K blocks 11K blocks 60K blocks 2 blocks 1 block 1 block 1 block Bloat comes in many disguises
  • 38. 0 1,000 2,000 3,000 4,000 5,000 6,000 7,000 8,000 1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 SizeinKB Minutes Heap + One Index - Update Single Row Regular Long Transaction Regular 1 Min Transaction Regular No Transaction HOT Long Transaction HOT 1 Min Transaction HOT No Transaction
  • 39. 0 100 200 300 400 500 600 700 800 900 1 2 3 4 5 6 7 8 9 101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 SizeinKB Minutes One Index - Update Single Row Regular Long Transaction Regular 1 Min Transaction Regular No Transaction Hot Long Transaction Hot 1 Min Transaction Hot No Transaction
  • 40. Measuring Longest Running Transaction postgres=# select max(now() - xact_start ) from pg_stat_activity; max ----------------- 02:02:48.021408
  • 41. One the fly cleanup - HEAP heap 1 2 lp index leaf index A index B index C tuple v1 block0 block1 tuple v2
  • 42. One the fly cleanup - HEAP heap 1 2 lp index leaf index A index B index C block0 block1 tuple v2
  • 43. One the fly cleanup - HEAP heap 1 2 lp index leaf index A index B index C block0 block1 tuple v2
  • 44. On the fly Heap Tuple Pruning – Full Table lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+---------+---------+--------+---------------------------------------------------+----------- 1 | 7976 | LP_NORMAL | 216 | 3265456 | 3265457 | (0,2) | XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 2 | 7760 | LP_NORMAL | 216 | 3265457 | 3265458 | (0,3) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 3 | 7544 | LP_NORMAL | 216 | 3265458 | 3265459 | (0,4) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 4 | 7328 | LP_NORMAL | 216 | 3265459 | 3265460 | (0,5) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 5 | 7112 | LP_NORMAL | 216 | 3265460 | 3265461 | (0,6) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 6 | 6896 | LP_NORMAL | 216 | 3265461 | 3265462 | (0,7) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 7 | 6680 | LP_NORMAL | 216 | 3265462 | 3265463 | (0,8) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 8 | 6464 | LP_NORMAL | 216 | 3265463 | 3265464 | (0,9) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 9 | 6248 | LP_NORMAL | 216 | 3265464 | 3265465 | (0,10) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 10 | 6032 | LP_NORMAL | 216 | 3265465 | 3265466 | (0,11) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 11 | 5816 | LP_NORMAL | 216 | 3265466 | 3265467 | (0,12) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 12 | 5600 | LP_NORMAL | 216 | 3265467 | 3265468 | (0,13) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 13 | 5384 | LP_NORMAL | 216 | 3265468 | 3265469 | (0,14) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 14 | 5168 | LP_NORMAL | 216 | 3265469 | 3265470 | (0,15) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 15 | 4952 | LP_NORMAL | 216 | 3265470 | 3265471 | (0,16) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 16 | 4736 | LP_NORMAL | 216 | 3265471 | 3265472 | (0,17) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 17 | 4520 | LP_NORMAL | 216 | 3265472 | 3265473 | (0,18) | UPDATED|XMAX_COMMITTED|XMIN_COMMITTED|HASVARWIDTH | 18 | 4304 | LP_NORMAL | 216 | 3265473 | 3265474 | (0,19) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | 19 | 4088 | LP_NORMAL | 216 | 3265474 | 0 | (0,19) | UPDATED|XMAX_INVALID|HASVARWIDTH | (19 rows)
  • 45. On the fly Heap Tuple Pruning – Pruned Table lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 ----+--------+-----------+--------+---------+---------+--------+------------------------------------+----------- 1 | 0 | LP_DEAD | 0 | | | | | 2 | 0 | LP_DEAD | 0 | | | | | 3 | 0 | LP_DEAD | 0 | | | | | 4 | 0 | LP_DEAD | 0 | | | | | 5 | 0 | LP_DEAD | 0 | | | | | 6 | 0 | LP_DEAD | 0 | | | | | 7 | 0 | LP_DEAD | 0 | | | | | 8 | 0 | LP_DEAD | 0 | | | | | 9 | 0 | LP_DEAD | 0 | | | | | 10 | 0 | LP_DEAD | 0 | | | | | 11 | 0 | LP_DEAD | 0 | | | | | 12 | 0 | LP_DEAD | 0 | | | | | 13 | 0 | LP_DEAD | 0 | | | | | 14 | 0 | LP_DEAD | 0 | | | | | 15 | 0 | LP_DEAD | 0 | | | | | 16 | 0 | LP_DEAD | 0 | | | | | 17 | 0 | LP_DEAD | 0 | | | | | 18 | 0 | LP_DEAD | 0 | | | | | 19 | 7976 | LP_NORMAL | 216 | 3265474 | 3265475 | (0,20) | UPDATED|XMIN_COMMITTED|HASVARWIDTH | 20 | 7760 | LP_NORMAL | 216 | 3265475 | 0 | (0,20) | UPDATED|XMAX_INVALID|HASVARWIDTH | (20 rows)
  • 46. On the fly Heap Tuple Pruning – Index Not! itemoffset | ctid | itemlen | nulls | vars | data ------------+--------+---------+-------+------+------------------------- 1 | (0,20) | 16 | f | f | b7 ab 03 00 00 00 00 00 2 | (0,19) | 16 | f | f | b7 ab 03 00 00 00 00 00 3 | (0,18) | 16 | f | f | b7 ab 03 00 00 00 00 00 4 | (0,17) | 16 | f | f | b7 ab 03 00 00 00 00 00 5 | (0,16) | 16 | f | f | b7 ab 03 00 00 00 00 00 6 | (0,15) | 16 | f | f | b7 ab 03 00 00 00 00 00 7 | (0,14) | 16 | f | f | b7 ab 03 00 00 00 00 00 8 | (0,13) | 16 | f | f | b7 ab 03 00 00 00 00 00 9 | (0,12) | 16 | f | f | b7 ab 03 00 00 00 00 00 10 | (0,11) | 16 | f | f | b7 ab 03 00 00 00 00 00 11 | (0,10) | 16 | f | f | b7 ab 03 00 00 00 00 00 12 | (0,9) | 16 | f | f | b7 ab 03 00 00 00 00 00 13 | (0,8) | 16 | f | f | b7 ab 03 00 00 00 00 00 14 | (0,7) | 16 | f | f | b7 ab 03 00 00 00 00 00 15 | (0,6) | 16 | f | f | b7 ab 03 00 00 00 00 00 16 | (0,5) | 16 | f | f | b7 ab 03 00 00 00 00 00 17 | (0,4) | 16 | f | f | b7 ab 03 00 00 00 00 00 18 | (0,3) | 16 | f | f | b7 ab 03 00 00 00 00 00 19 | (0,2) | 16 | f | f | b7 ab 03 00 00 00 00 00 20 | (0,1) | 16 | f | f | b7 ab 03 00 00 00 00 00 (20 rows)
  • 47. One the fly cleanup - Index heap 1 2 lp index leaf index A index B index C block0 block1 tuple v2
  • 48. One the fly cleanup - Index heap 1 2 lp index leaf index A index B index C block0 block1 tuple v2
  • 49. Index on fly cleanup – almost full page itemoffset | ctid | itemlen | nulls | vars | data ------------+---------+---------+-------+------+------------------------- 1 | (1,116) | 16 | f | f | b5 ab 03 00 00 00 00 00 2 | (1,115) | 16 | f | f | b5 ab 03 00 00 00 00 00 3 | (1,114) | 16 | f | f | b5 ab 03 00 00 00 00 00 4 | (1,113) | 16 | f | f | b5 ab 03 00 00 00 00 00 5 | (1,112) | 16 | f | f | b5 ab 03 00 00 00 00 00 6 | (1,111) | 16 | f | f | b5 ab 03 00 00 00 00 00 7 | (1,110) | 16 | f | f | b5 ab 03 00 00 00 00 00 8 | (1,109) | 16 | f | f | b5 ab 03 00 00 00 00 00 9 | (1,108) | 16 | f | f | b5 ab 03 00 00 00 00 00 10 | (1,107) | 16 | f | f | b5 ab 03 00 00 00 00 00 11 | (1,106) | 16 | f | f | b5 ab 03 00 00 00 00 00 12 | (1,105) | 16 | f | f | b5 ab 03 00 00 00 00 00 … 397 | (0,11) | 16 | f | f | b5 ab 03 00 00 00 00 00 398 | (0,10) | 16 | f | f | b5 ab 03 00 00 00 00 00 399 | (0,9) | 16 | f | f | b5 ab 03 00 00 00 00 00 400 | (0,8) | 16 | f | f | b5 ab 03 00 00 00 00 00 401 | (0,7) | 16 | f | f | b5 ab 03 00 00 00 00 00 402 | (0,6) | 16 | f | f | b5 ab 03 00 00 00 00 00 403 | (0,5) | 16 | f | f | b5 ab 03 00 00 00 00 00 404 | (0,4) | 16 | f | f | b5 ab 03 00 00 00 00 00 405 | (0,3) | 16 | f | f | b5 ab 03 00 00 00 00 00 406 | (0,2) | 16 | f | f | b5 ab 03 00 00 00 00 00 407 | (0,1) | 16 | f | f | b5 ab 03 00 00 00 00 00 (407 rows)
  • 50. Index on fly cleanup – cleaned up itemoffset | ctid | itemlen | nulls | vars | data ------------+---------+---------+-------+------+------------------------- 1 | (1,117) | 16 | f | f | b5 ab 03 00 00 00 00 00 2 | (1,116) | 16 | f | f | b5 ab 03 00 00 00 00 00 (2 rows)
  • 51. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 52. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1 Scan to find id’s
  • 53. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 54. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 55. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 56. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 57. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 58. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 59. Vacuum heap 1 2 lp index leaf index A index B index C block0 block1
  • 60. Vacuum Block Cleanup – Lots of DEAD LP’s lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 -----+--------+----------+--------+--------+--------+--------+----------+----------- 1 | 0 | LP_DEAD | 0 | | | | | 2 | 0 | LP_DEAD | 0 | | | | | 3 | 0 | LP_DEAD | 0 | | | | | 4 | 0 | LP_DEAD | 0 | | | | | 5 | 0 | LP_DEAD | 0 | | | | | 6 | 0 | LP_DEAD | 0 | | | | | 7 | 0 | LP_DEAD | 0 | | | | | 8 | 0 | LP_DEAD | 0 | | | | | 9 | 0 | LP_DEAD | 0 | | | | | 10 | 0 | LP_DEAD | 0 | | | | | ... 281 | 0 | LP_DEAD | 0 | | | | | 282 | 0 | LP_DEAD | 0 | | | | | 283 | 0 | LP_DEAD | 0 | | | | | 284 | 0 | LP_DEAD | 0 | | | | | 285 | 0 | LP_DEAD | 0 | | | | | 286 | 0 | LP_DEAD | 0 | | | | | 287 | 0 | LP_DEAD | 0 | | | | | 288 | 0 | LP_DEAD | 0 | | | | | 289 | 0 | LP_DEAD | 0 | | | | | 290 | 0 | LP_DEAD | 0 | | | | | 291 | 0 | LP_DEAD | 0 | | | | | (291 rows)
  • 61. Vacuum Block Cleanup – Unused LP’s lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_ctid | infomask | infomask2 -----+--------+-----------+--------+--------+--------+--------+----------+----------- 1 | 0 | LP_UNUSED | 0 | | | | | 2 | 0 | LP_UNUSED | 0 | | | | | 3 | 0 | LP_UNUSED | 0 | | | | | 4 | 0 | LP_UNUSED | 0 | | | | | 5 | 0 | LP_UNUSED | 0 | | | | | 6 | 0 | LP_UNUSED | 0 | | | | | 7 | 0 | LP_UNUSED | 0 | | | | | 8 | 0 | LP_UNUSED | 0 | | | | | 9 | 0 | LP_UNUSED | 0 | | | | | 10 | 0 | LP_UNUSED | 0 | | | | | ... 281 | 0 | LP_UNUSED | 0 | | | | | 282 | 0 | LP_UNUSED | 0 | | | | | 283 | 0 | LP_UNUSED | 0 | | | | | 284 | 0 | LP_UNUSED | 0 | | | | | 285 | 0 | LP_UNUSED | 0 | | | | | 286 | 0 | LP_UNUSED | 0 | | | | | 287 | 0 | LP_UNUSED | 0 | | | | | 288 | 0 | LP_UNUSED | 0 | | | | | 289 | 0 | LP_UNUSED | 0 | | | | | 290 | 0 | LP_UNUSED | 0 | | | | | 291 | 0 | LP_UNUSED | 0 | | | | | (291 rows)
  • 62. Is that an update? ORM cases ORM and other software sometimes update all columns in table including all indexed columns UPDATE to NEW VALUE postgres=# update benchmark_uuid2 set last_updated = now() where id=2; UPDATE 1 postgres=# select n_tup_upd, n_tup_hot_upd from pg_stat_all_tables where relname = 'benchmark_uuid2'; n_tup_upd | n_tup_hot_upd -----------+--------------- 1 | 0 UPDATE to SAME VALUE (i.e. ORM case) postgres=# update benchmark_uuid2 set last_updated = ( select last_updated benchmark_uuid2 where id=2) where id=2; UPDATE 1 postgres=# select n_tup_upd, n_tup_hot_upd from pg_stat_all_tables where relname = 'benchmark_uuid2'; n_tup_upd | n_tup_hot_upd -----------+--------------- 2 | 1 (1 row) !=
  • 63. Index Tests – A table with 2 to 64 indexes Create the table with a PK, 64 Random int Columns and 1 last updated timestamp create table benchmark_serial ( pk serial constraint pk_benchmark_serial_pk PRIMARY KEY, a1 int not null, ….. a64 int not null, last_updated timestamp ); Create between 2 and 64 indexes on the random int columns create index i_benchmark_serial_a1 on benchmark_serial (a1); …. create index i_benchmark_serial_a64 on benchmark_serial (a64); For the Regular Test create index i_benchmark_serial_lu on benchmark_serial (last_updated);
  • 64. Full Page Writes Block in Memory PostgreSQL update t set y = 6; Full Block WAL
  • 65. Full Page Writes Block in Memory PostgreSQL update t set y = 6; Full Block WAL
  • 66. Full Page Writes Block in Memory PostgreSQL update t set y = 6; Checkpoint Datafile Full Block WAL Archive
  • 67. Full Page Writes Block in Memory PostgreSQL update t set y = 6; Checkpoint Datafile Full Block WAL Archive 4K 4K 8K
  • 68. Full Page Writes Block in Memory PostgreSQL update t set y = 6; Checkpoint Datafile Full Block WAL Archive 4K 4K 8K During crash recovery PostgreSQL uses the FPW block in the WAL to replace the bad checkpointed block
  • 76. HOT Updates – Looking at FPW in the logs HOT Updated Heap 14/ 68, , d: HOT_UPDATE off 19 xmax 2327993188 ; new off 3 xmax 0, blkref #0: rel 1663/41083/41086 blk 28 XLOG 0/ 3368, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41092 blk 1492899 FPW Transaction 8/ 34, , d: COMMIT 2017-09-07 00:07:17.532647 UTC Non HOT Update Heap 14/ 75, , d: UPDATE off 67 xmax 2327993195 ; new off 7 xmax 0, blkref #0: rel 1663/41083/41086 blk 285 XLOG 0/ 2774, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41090 blk 7039952 FPW Btree 2/ 120, , d: INSERT_LEAF off 17, blkref #0: rel 1663/41083/41090 blk 7039952 XLOG 0/ 3150, , d: FPI_FOR_HINT , blkref #0: rel 1663/41083/41092 blk 29 FPW Btree 2/ 64, , d: INSERT_LEAF off 205, blkref #0: rel 1663/41083/41092 blk 29 Btree 2/ 2639, , d: INSERT_LEAF off 73, blkref #0: rel 1663/41083/41093 blk 4 FPW Btree 2/ 3148, , d: INSERT_LEAF off 2, blkref #0: rel 1663/41083/41094 blk 1 FPW Btree 2/ 5099, , d: INSERT_LEAF off 364, blkref #0: rel 1663/41083/41095 blk 4237904 FPW Transaction 8/ 34, , d: COMMIT 2017-09-07 00:24:29.427017 UTC 3.4K VS 16.7K
  • 77. - 5,000 10,000 15,000 20,000 25,000 30,000 35,000 40,000 45,000 2 4 8 16 32 64 TransactionsPerSecond(TPS) Number of Indexes Updates with 100 Clients HOT Regular 35X
  • 78. Index Tests – Vacuuming benchdb=> vacuum verbose benchmark_serial; INFO: vacuuming "public.benchmark_serial" INFO: scanned index "pk_benchmark_serial_pk" to remove 1939503 row versions DETAIL: CPU 0.05s/4.93u sec elapsed 5.52 sec INFO: scanned index "i_benchmark_serial_a1" to remove 1939503 row versions DETAIL: CPU 0.00s/9.52u sec elapsed 9.67 sec INFO: scanned index "i_benchmark_serial_a2" to remove 1939503 row versions DETAIL: CPU 0.02s/9.26u sec elapsed 9.43 sec INFO: scanned index "i_benchmark_serial_a3" to remove 1939503 row versions DETAIL: CPU 0.00s/9.22u sec elapsed 9.49 sec INFO: scanned index "i_benchmark_serial_a4" to remove 1939503 row versions DETAIL: CPU 0.00s/9.05u sec elapsed 9.23 sec INFO: scanned index "i_benchmark_serial_a5" to remove 1939503 row versions DETAIL: CPU 0.00s/9.13u sec elapsed 9.44 sec INFO: scanned index "i_benchmark_serial_a6" to remove 1939503 row versions DETAIL: CPU 0.00s/9.21u sec elapsed 9.37 sec INFO: scanned index "i_benchmark_serial_a7" to remove 1939503 row versions DETAIL: CPU 0.01s/9.18u sec elapsed 9.57 sec INFO: scanned index "i_benchmark_serial_a8" to remove 1939503 row versions DETAIL: CPU 0.00s/9.22u sec elapsed 9.49 sec INFO: scanned index "i_benchmark_serial_a9" to remove 1939503 row versions ….. DETAIL: CPU 0.02s/9.03u sec elapsed 9.56 sec INFO: scanned index "i_benchmark_serial_a16" to remove 1939503 row versions …..
  • 79. 0 100 200 300 400 500 600 700 2 4 8 16 32 64 Seconds Number of Indexes Vacuum Time per 1M Updates HOT Regular 101X
  • 80. Example – Keep track of table changes PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 7 19-OCT-2009 4 A A1 MFM USEFUL 2 21-OCT-1972
  • 81. Example – Keep track of table changes PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 7 19-OCT-2009 4 A A1 MFM USEFUL 2 21-OCT-1972 Data Lake
  • 82. Example – Keep track of table changes PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 7 19-OCT-2009 4 A A1 MFM USEFUL 2 21-OCT-1972 Data Lake Full Table Scan
  • 83. Example – Build an index on Last Updated PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 8 15-OCT-2018 4 A A1 MFM USEFUL 2 21-OCT-1972 Data Lake Index Scan
  • 84. Example – Build an index on Last Updated PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 8 15-OCT-2018 4 A A1 MFM USEFUL 2 21-OCT-1972 Data Lake Index Scan Before: Updates to C1,C3,C4, Last Updated are HOT After: Every update is a regular update
  • 85. Example – Logical Replication PK C1 C2 C3 C4 C4 Last Updated 1 X A1 FOO HOT 9 01-Jun-1999 2 Y A2 BAR IS 9 01-Jul-2001 3 Z A2 RLL REALLY 7 19-OCT-2009 4 A A1 MFM USEFUL 2 21-OCT-1972 All changes WAL logged WAL Logical Decoding and Replication Data Lake

Editor's Notes

  1. Ask about preview environment and other decoders