PGCon2018 - 2.5

PGCon 2018
The PostgreSQL Conference

Amit Kapila
Robert Haas
Day Talks - Day 2: Friday - 2018-06-01
Room DMS 1160
Start time 15:00
Duration 00:45
ID 1190
Event type Lecture
Track New Features
Language used for presentation English

zheap: less bloat, fewer writes, and just plain smaller

zheap: less bloat, fewer writes, and just plain smaller

To support MVCC, we always create a new version of a tuple on an update which must eventually be removed by periodic vacuuming or by HOT-pruning, but still in many cases space is never reclaimed completely. A similar problem occurs for tuples that are deleted. This leads to bloat in the database. In this talk, we will present a new storage format which will reduce the bloat, performs lesser disk writes and is smaller in size as compared to the current format.

This talk will discuss a new storage format in which only the latest version of the data is kept in main storage and the old versions will be moved to an undo log. We call this new storage format "zheap". It can prevent bloat by (a) allowing in-place updates wherever possible and (b) reusing the space as soon as the transaction that has performed delete or non-inplace-update is committed. In short, in this new storage, bloat won't be created at first place.

The new storage format reduces write amplification both by avoiding rewrites of heap pages and by making it possible to do an update that touches indexed columns without updating every index.

We will also discuss another major advantage of this project which comes from the fact that it helps in reducing the size of the heap by (a) reducing tuple header size and (b) eliminating the need for aligning data in many cases.

This talk will also present some performance results which are based on the prototype of this storage format.