Re: [PoC] Improve dead tuple storage for lazy vacuum

John Naylor <john.naylor@enterprisedb.com>

From: John Naylor <john.naylor@enterprisedb.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Andres Freund <andres@anarazel.de>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Yura Sokolov <y.sokolov@postgrespro.ru>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2022-12-06T10:32:08Z
Lists: pgsql-hackers

Attachments

On Fri, Dec 2, 2022 at 11:42 PM Masahiko Sawada <sawada.mshk@gmail.com>
wrote:
>
> > On Mon, Nov 14, 2022 at 7:59 PM John Naylor <
john.naylor@enterprisedb.com> wrote:
> > >
> > > - Optimize node128 insert.
> >
> > I've attached a rough start at this. The basic idea is borrowed from
our bitmapset nodes, so we can iterate over and operate on word-sized (32-
or 64-bit) types at a time, rather than bytes.
>
> Thanks! I think this is a good idea.
>
> > To make this easier, I've moved some of the lower-level macros and
types from bitmapset.h/.c to pg_bitutils.h. That's probably going to need a
separate email thread to resolve the coding style clash this causes, so
that can be put off for later.

I started a separate thread [1], and 0002 comes from feedback on that.
There is a FIXME about using WORDNUM and BITNUM, at least with that
spelling. I'm putting that off to ease rebasing the rest as v13 -- getting
some CI testing with 0002 seems like a good idea. There are no other
changes yet. Next, I will take a look at templating local vs. shared
memory. I might try basing that on the styles of both v12 and v8, and see
which one works best with templating.

[1]
https://www.postgresql.org/message-id/CAFBsxsFW2JjTo58jtDB%2B3sZhxMx3t-3evew8%3DAcr%2BGGhC%2BkFaA%40mail.gmail.com

--
John Naylor
EDB: http://www.enterprisedb.com

Commits

  1. radixtree: Fix SIGSEGV at update of embeddable value to non-embeddable.

  2. Get rid of anonymous struct

  3. Teach radix tree to embed values at runtime

  4. Teach TID store to skip bitmap for small numbers of offsets

  5. Use bump context for TID bitmaps stored by vacuum

  6. Fix alignment of stack variable

  7. Use TidStore for dead tuple TIDs storage during lazy vacuum.

  8. Rethink create and attach APIs of shared TidStore.

  9. Fix inconsistent function prototypes with function definitions.

  10. Fix a calculation in TidStoreCreate().

  11. Fix potential integer handling issue in radixtree.h.

  12. Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently.

  13. Fix link error for test_radixtree module on Windows

  14. Blind attempt to fix ODR violations

  15. Fix incorrect format specifier for int64

  16. Fix redefinition of typedefs

  17. Add template for adaptive radix tree

  18. Fix signedness error in 9f225e992 for gcc

  19. Introduce helper SIMD functions for small byte arrays

  20. Optimize vacuuming of relations with no indexes.

  21. Add bound check before bsearch() for performance

  22. Allocate consecutive blocks during parallel seqscans