pgsql: tableam: Avoid relying on relation size to determine validity of

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: tableam: Avoid relying on relation size to determine validity of

Andres Freund
tableam: Avoid relying on relation size to determine validity of tids.

Instead add a tableam callback to do so. To avoid adding per
validation overhead, pass a scan to tuple_tid_valid. In heap's case
we'd otherwise incurred a RelationGetNumberOfBlocks() call for each
tid - which'd have added noticable overhead to nodeTidscan.c.

Author: Andres Freund
Reviewed-By: Ashwin Agrawal
Discussion: https://postgr.es/m/20190515185447.gno2jtqxyktylyvs@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/147e3722f7e531f15ba389a4d518efe8cd0bd736

Modified Files
--------------
src/backend/access/heap/heapam.c         | 26 ++++--------
src/backend/access/heap/heapam_handler.c | 10 +++++
src/backend/access/table/tableam.c       | 27 ++++++++++++
src/backend/executor/nodeTidscan.c       | 73 +++++++++++++++++++++-----------
src/backend/utils/adt/tid.c              | 10 ++++-
src/include/access/heapam.h              |  3 +-
src/include/access/tableam.h             | 37 +++++++++++-----
7 files changed, 129 insertions(+), 57 deletions(-)