Commit 21039555 authored by Andres Freund's avatar Andres Freund

tableam: comment improvements.

Author: Brad DeJong
Discussion: https://postgr.es/m/CAJnrtnxDYOQFsDfWz2iri0T_fFL2ZbbzgCOE=4yaMcszgcsf4A@mail.gmail.com
Backpatch: 12-
parent 1c1602b8
...@@ -294,7 +294,7 @@ typedef struct TableAmRoutine ...@@ -294,7 +294,7 @@ typedef struct TableAmRoutine
* *
* *all_dead, if all_dead is not NULL, should be set to true by * *all_dead, if all_dead is not NULL, should be set to true by
* index_fetch_tuple iff it is guaranteed that no backend needs to see * index_fetch_tuple iff it is guaranteed that no backend needs to see
* that tuple. Index AMs can use that do avoid returning that tid in * that tuple. Index AMs can use that to avoid returning that tid in
* future searches. * future searches.
*/ */
bool (*index_fetch_tuple) (struct IndexFetchTableData *scan, bool (*index_fetch_tuple) (struct IndexFetchTableData *scan,
...@@ -482,9 +482,9 @@ typedef struct TableAmRoutine ...@@ -482,9 +482,9 @@ typedef struct TableAmRoutine
double *tups_recently_dead); double *tups_recently_dead);
/* /*
* React to VACUUM command on the relation. The VACUUM might be user * React to VACUUM command on the relation. The VACUUM can be
* triggered or by autovacuum. The specific actions performed by the AM * triggered by a user or by autovacuum. The specific actions
* will depend heavily on the individual AM. * performed by the AM will depend heavily on the individual AM.
* *
* On entry a transaction is already established, and the relation is * On entry a transaction is already established, and the relation is
* locked with a ShareUpdateExclusive lock. * locked with a ShareUpdateExclusive lock.
...@@ -661,7 +661,7 @@ typedef struct TableAmRoutine ...@@ -661,7 +661,7 @@ typedef struct TableAmRoutine
* false if the sample scan is finished, true otherwise. `scan` was * false if the sample scan is finished, true otherwise. `scan` was
* started via table_beginscan_sampling(). * started via table_beginscan_sampling().
* *
* Typically this will first determine the target block by call the * Typically this will first determine the target block by calling the
* TsmRoutine's NextSampleBlock() callback if not NULL, or alternatively * TsmRoutine's NextSampleBlock() callback if not NULL, or alternatively
* perform a sequential scan over all blocks. The determined block is * perform a sequential scan over all blocks. The determined block is
* then typically read and pinned. * then typically read and pinned.
...@@ -679,7 +679,7 @@ typedef struct TableAmRoutine ...@@ -679,7 +679,7 @@ typedef struct TableAmRoutine
* *
* Currently it is required to implement this interface, as there's no * Currently it is required to implement this interface, as there's no
* alternative way (contrary e.g. to bitmap scans) to implement sample * alternative way (contrary e.g. to bitmap scans) to implement sample
* scans. If infeasible to implement the AM may raise an error. * scans. If infeasible to implement, the AM may raise an error.
*/ */
bool (*scan_sample_next_block) (TableScanDesc scan, bool (*scan_sample_next_block) (TableScanDesc scan,
struct SampleScanState *scanstate); struct SampleScanState *scanstate);
...@@ -1084,9 +1084,8 @@ table_compute_xid_horizon_for_tuples(Relation rel, ...@@ -1084,9 +1084,8 @@ table_compute_xid_horizon_for_tuples(Relation rel,
/* /*
* Insert a tuple from a slot into table AM routine. * Insert a tuple from a slot into table AM routine.
* *
* The options bitmask allows to specify options that allow to change the * The options bitmask allows the caller to specify options that may change the
* behaviour of the AM. Several options might be ignored by AMs not supporting * behaviour of the AM. The AM will ignore options that it does not support.
* them.
* *
* If the TABLE_INSERT_SKIP_WAL option is specified, the new tuple doesn't * If the TABLE_INSERT_SKIP_WAL option is specified, the new tuple doesn't
* need to be logged to WAL, even for a non-temp relation. It is the AMs * need to be logged to WAL, even for a non-temp relation. It is the AMs
...@@ -1094,8 +1093,9 @@ table_compute_xid_horizon_for_tuples(Relation rel, ...@@ -1094,8 +1093,9 @@ table_compute_xid_horizon_for_tuples(Relation rel,
* *
* If the TABLE_INSERT_SKIP_FSM option is specified, AMs are free to not reuse * If the TABLE_INSERT_SKIP_FSM option is specified, AMs are free to not reuse
* free space in the relation. This can save some cycles when we know the * free space in the relation. This can save some cycles when we know the
* relation is new and doesn't contain useful amounts of free space. It's * relation is new and doesn't contain useful amounts of free space.
* commonly passed directly to RelationGetBufferForTuple, see for more info. * TABLE_INSERT_SKIP_FSM is commonly passed directly to
* RelationGetBufferForTuple. See that method for more information.
* *
* TABLE_INSERT_FROZEN should only be specified for inserts into * TABLE_INSERT_FROZEN should only be specified for inserts into
* relfilenodes created during the current subtransaction and when * relfilenodes created during the current subtransaction and when
...@@ -1111,7 +1111,6 @@ table_compute_xid_horizon_for_tuples(Relation rel, ...@@ -1111,7 +1111,6 @@ table_compute_xid_horizon_for_tuples(Relation rel,
* Note that most of these options will be applied when inserting into the * Note that most of these options will be applied when inserting into the
* heap's TOAST table, too, if the tuple requires any out-of-line data. * heap's TOAST table, too, if the tuple requires any out-of-line data.
* *
*
* The BulkInsertState object (if any; bistate can be NULL for default * The BulkInsertState object (if any; bistate can be NULL for default
* behavior) is also just passed through to RelationGetBufferForTuple. If * behavior) is also just passed through to RelationGetBufferForTuple. If
* `bistate` is provided, table_finish_bulk_insert() needs to be called. * `bistate` is provided, table_finish_bulk_insert() needs to be called.
...@@ -1383,13 +1382,13 @@ table_relation_copy_data(Relation rel, const RelFileNode *newrnode) ...@@ -1383,13 +1382,13 @@ table_relation_copy_data(Relation rel, const RelFileNode *newrnode)
* Additional Input parameters: * Additional Input parameters:
* - use_sort - if true, the table contents are sorted appropriate for * - use_sort - if true, the table contents are sorted appropriate for
* `OldIndex`; if false and OldIndex is not InvalidOid, the data is copied * `OldIndex`; if false and OldIndex is not InvalidOid, the data is copied
* in that index's order; if false and OidIndex is InvalidOid, no sorting is * in that index's order; if false and OldIndex is InvalidOid, no sorting is
* performed * performed
* - OidIndex - see use_sort * - OldIndex - see use_sort
* - OldestXmin - computed by vacuum_set_xid_limits(), even when * - OldestXmin - computed by vacuum_set_xid_limits(), even when
* not needed for the relation's AM * not needed for the relation's AM
* - *xid_cutoff - dito * - *xid_cutoff - ditto
* - *multi_cutoff - dito * - *multi_cutoff - ditto
* *
* Output parameters: * Output parameters:
* - *xid_cutoff - rel's new relfrozenxid value, may be invalid * - *xid_cutoff - rel's new relfrozenxid value, may be invalid
...@@ -1416,10 +1415,10 @@ table_relation_copy_for_cluster(Relation OldTable, Relation NewTable, ...@@ -1416,10 +1415,10 @@ table_relation_copy_for_cluster(Relation OldTable, Relation NewTable,
} }
/* /*
* Perform VACUUM on the relation. The VACUUM can be user-triggered or by * Perform VACUUM on the relation. The VACUUM can be triggered by a user or by
* autovacuum. The specific actions performed by the AM will depend heavily on * autovacuum. The specific actions performed by the AM will depend heavily on
* the individual AM. * the individual AM.
*
* On entry a transaction needs to already been established, and the * On entry a transaction needs to already been established, and the
* table is locked with a ShareUpdateExclusive lock. * table is locked with a ShareUpdateExclusive lock.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment