BitmapHeapScan uses the read stream API
authorMelanie Plageman <melanieplageman@gmail.com>
Sat, 15 Mar 2025 14:34:42 +0000 (10:34 -0400)
committerMelanie Plageman <melanieplageman@gmail.com>
Sat, 15 Mar 2025 14:34:42 +0000 (10:34 -0400)
commit2b73a8cd33b745c5b8a7f44322f86642519e3a40
tree43c4cb7aa83247b634ff15d4df76a75f16221230
parent944e81bf99db2b5b70b8a389d4f273534da73f74
BitmapHeapScan uses the read stream API

Make Bitmap Heap Scan use the read stream API instead of invoking
ReadBuffer() for each block indicated by the bitmap.

The read stream API handles prefetching, so remove all of the explicit
prefetching from bitmap heap scan code.

Now, heap table AM implements a read stream callback which uses the
bitmap iterator to return the next required block to the read stream
code.

Tomas Vondra conducted extensive regression testing of this feature.
Andres Freund, Thomas Munro, and I analyzed regressions and Thomas Munro
patched the read stream API.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Tested-by: Tomas Vondra <tomas@vondra.me>
Tested-by: Andres Freund <andres@anarazel.de>
Tested-by: Thomas Munro <thomas.munro@gmail.com>
Tested-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/flat/CAAKRu_ZwCwWFeL_H3ia26bP2e7HiKLWt0ZmGXPVwPO6uXq0vaA%40mail.gmail.com
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam_handler.c
src/backend/executor/nodeBitmapHeapscan.c
src/include/access/tableam.h
src/include/nodes/execnodes.h