pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Generalize relation analyze in table AM interface
Date: Sat, 30 Mar 2024 20:54:54 +0000
Message-ID: <E1rqfj4-006YS4-Hj@gemulon.postgresql.org> (raw)

Generalize relation analyze in table AM interface

Currently, there is just one algorithm for sampling tuples from a table written
in acquire_sample_rows().  Custom table AM can just redefine the way to get the
next block/tuple by implementing scan_analyze_next_block() and
scan_analyze_next_tuple() API functions.

This approach doesn't seem general enough.  For instance, it's unclear how to
sample this way index-organized tables.  This commit allows table AM to
encapsulate the whole sampling algorithm (currently implemented in
acquire_sample_rows()) into the relation_analyze() API function.

Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com
Reviewed-by: Pavel Borisov, Matthias van de Meent

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/27bc1772fc814946918a5ac8ccb9b5c5ad0380aa

Modified Files
--------------
src/backend/access/heap/heapam_handler.c |  29 ++++++---
src/backend/access/table/tableamapi.c    |   2 -
src/backend/commands/analyze.c           |  54 ++++++++--------
src/include/access/heapam.h              |   9 +++
src/include/access/tableam.h             | 106 +++++++------------------------
src/include/commands/vacuum.h            |  19 ++++++
src/include/foreign/fdwapi.h             |   6 +-
7 files changed, 100 insertions(+), 125 deletions(-)



view thread (2+ messages)

Message-ID: <E1rqfj4-006YS4-Hj@gemulon.postgresql.org>
Permalink:  ../E1rqfj4-006YS4-Hj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rqfj4-006YS4-Hj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Generalize relation analyze in table AM interface
  In-Reply-To: <E1rqfj4-006YS4-Hj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox