diff options
| author | Robert Haas | 2019-07-08 18:51:53 +0000 |
|---|---|---|
| committer | Robert Haas | 2019-07-08 18:51:53 +0000 |
| commit | 554106b1163853757b72ce14d7db5050c32bfa6a (patch) | |
| tree | a85a29d87c4124e575ad24dc8a5627878b1024aa /src/include | |
| parent | 482501d433b9f218d5a117571f1df9aebefe68bb (diff) | |
tableam: Provide helper functions for relation sizing.
Most block-based table AMs will need the exact same implementation of
the relation_size callback as the heap, and if they use a standard
page layout, they will likely need an implementation of the
relation_estimate_size callback that is very similar to that of the
heap. Rearrange to facilitate code reuse.
Patch by me, reviewed by Michael Paquier, Daniel Gustafsson, and
Álvaro Herrera.
Discussion: http://postgr.es/m/CA+TgmoZ6DBPnP1E-vRpQZUJQijJFD54F+SR_pxGiAAS-MyrigA@mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/tableam.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/access/tableam.h b/src/include/access/tableam.h index fd07773b74f..7edfcf3ef9c 100644 --- a/src/include/access/tableam.h +++ b/src/include/access/tableam.h @@ -1728,6 +1728,20 @@ extern void table_block_parallelscan_startblock_init(Relation rel, /* ---------------------------------------------------------------------------- + * Helper functions to implement relation sizing for block oriented AMs. + * ---------------------------------------------------------------------------- + */ + +extern uint64 table_block_relation_size(Relation rel, ForkNumber forkNumber); +extern void table_block_relation_estimate_size(Relation rel, + int32 *attr_widths, + BlockNumber *pages, + double *tuples, + double *allvisfrac, + Size overhead_bytes_per_tuple, + Size usable_bytes_per_page); + +/* ---------------------------------------------------------------------------- * Functions in tableamapi.c * ---------------------------------------------------------------------------- */ |
