diff options
| author | Alexander Korotkov | 2024-04-16 10:14:20 +0000 |
|---|---|---|
| committer | Alexander Korotkov | 2024-04-16 10:14:20 +0000 |
| commit | 6377e12a5a5278446bb0d215439b4825ef8996d1 (patch) | |
| tree | 219f016bf3f9c8ac2d5b1ac95db4e7876898105d /src/include/commands | |
| parent | bea97cd02ebb347ab469b78673c2b33a72109669 (diff) | |
revert: Generalize relation analyze in table AM interface
This commit reverts 27bc1772fc and dd1f6b0c17. Per review by Andres Freund.
Discussion: https://postgr.es/m/20240415201057.khoyxbwwxfgzomeo%40awork3.anarazel.de
Diffstat (limited to 'src/include/commands')
| -rw-r--r-- | src/include/commands/vacuum.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index 12a03abb75a..759f9a87d38 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -21,11 +21,9 @@ #include "catalog/pg_class.h" #include "catalog/pg_statistic.h" #include "catalog/pg_type.h" -#include "executor/tuptable.h" #include "parser/parse_node.h" #include "storage/buf.h" #include "storage/lock.h" -#include "storage/read_stream.h" #include "utils/relcache.h" /* @@ -178,21 +176,6 @@ typedef struct VacAttrStats int rowstride; } VacAttrStats; -/* - * AcquireSampleRowsFunc - a function for the sampling statistics collection. - * - * A random sample of up to `targrows` rows should be collected from the - * table and stored into the caller-provided `rows` array. The actual number - * of rows collected must be returned. In addition, a function should store - * estimates of the total numbers of live and dead rows in the table into the - * output parameters `*totalrows` and `*totaldeadrows1. (Set `*totaldeadrows` - * to zero if the storage does not have any concept of dead rows.) - */ -typedef int (*AcquireSampleRowsFunc) (Relation relation, int elevel, - HeapTuple *rows, int targrows, - double *totalrows, - double *totaldeadrows); - /* flag bits for VacuumParams->options */ #define VACOPT_VACUUM 0x01 /* do VACUUM */ #define VACOPT_ANALYZE 0x02 /* do ANALYZE */ @@ -392,61 +375,9 @@ extern void parallel_vacuum_cleanup_all_indexes(ParallelVacuumState *pvs, extern void parallel_vacuum_main(dsm_segment *seg, shm_toc *toc); /* in commands/analyze.c */ - -struct TableScanDescData; - - -/* - * A callback to prepare to analyze block from `stream` of `scan`. The scan - * has been started with table_beginscan_analyze(). - * - * The callback may acquire resources like locks that are held until - * ScanAnalyzeNextTupleFunc returns false. In some cases it could be - * useful to hold a lock until all tuples in a block have been analyzed by - * ScanAnalyzeNextTupleFunc. - * - * The callback can return false if the block is not suitable for - * sampling, e.g. because it's a metapage that could never contain tuples. - * - * This is primarily suited for block-based AMs. It's not clear what a - * good interface for non block-based AMs would be, so there isn't one - * yet and sampling using a custom implementation of acquire_sample_rows - * may be preferred. - */ -typedef bool (*ScanAnalyzeNextBlockFunc) (struct TableScanDescData *scan, - ReadStream *stream); - -/* - * A callback to iterate over tuples in the block selected with - * ScanAnalyzeNextBlockFunc (which needs to have returned true, and - * this routine may not have returned false for the same block before). If - * a tuple that's suitable for sampling is found, true is returned and a - * tuple is stored in `slot`. - * - * *liverows and *deadrows are incremented according to the encountered - * tuples. - * - * Not every AM might have a meaningful concept of dead rows, in which - * case it's OK to not increment *deadrows - but note that that may - * influence autovacuum scheduling (see comment for relation_vacuum - * callback). - */ -typedef bool (*ScanAnalyzeNextTupleFunc) (struct TableScanDescData *scan, - TransactionId OldestXmin, - double *liverows, - double *deadrows, - TupleTableSlot *slot); - extern void analyze_rel(Oid relid, RangeVar *relation, VacuumParams *params, List *va_cols, bool in_outer_xact, BufferAccessStrategy bstrategy); -extern void block_level_table_analyze(Relation relation, - AcquireSampleRowsFunc *func, - BlockNumber *totalpages, - BufferAccessStrategy bstrategy, - ScanAnalyzeNextBlockFunc scan_analyze_next_block_cb, - ScanAnalyzeNextTupleFunc scan_analyze_next_tuple_cb); - extern bool std_typanalyze(VacAttrStats *stats); /* in utils/misc/sampling.c --- duplicate of declarations in utils/sampling.h */ |
