typedef Datum (*AnalyzeAttrFetchFunc) (VacAttrStatsP stats, int rownum, bool *isNull);
typedefvoid (*AnalyzeAttrComputeStatsFunc) (VacAttrStatsP stats,
AnalyzeAttrFetchFunc fetchfunc, int samplerows, double totalrows);
typedefstruct VacAttrStats
{ /* *ThesefieldsaresetupbythemainANALYZEcodebeforeinvokingthe *type-specifictypanalyzefunction.Theydon'tnecessarilymatchwhat *isinpg_attribute,becausesomeindexopclassesstoreadifferenttype *thantheunderlyingcolumn/expression.Therefore,usethesefieldsfor *informationaboutthedatatypebeingfedtothetypanalyzefunction.
*/ int attstattarget; /* -1 to use default */
Oid attrtypid; /* type of data being analyzed */
int32 attrtypmod; /* typmod of data being analyzed */
Form_pg_type attrtype; /* copy of pg_type row for attrtypid */
Oid attrcollid; /* collation of data being analyzed */
MemoryContext anl_context; /* where to save long-lived data */
/* *Thesefieldsmustbefilledinbythetypanalyzeroutine,unlessit *returnsfalse.
*/
AnalyzeAttrComputeStatsFunc compute_stats; /* function pointer */ int minrows; /* Minimum # of rows wanted for stats */ void *extra_data; /* for extra type-specific data */
/* *Thesefieldsaretobefilledinbythecompute_statsroutine.(They *areinitializedtozerowhenthestructiscreated.)
*/ bool stats_valid;
float4 stanullfrac; /* fraction of entries that are NULL */
int32 stawidth; /* average width of column values */
float4 stadistinct; /* # distinct values */
int16 stakind[STATISTIC_NUM_SLOTS];
Oid staop[STATISTIC_NUM_SLOTS];
Oid stacoll[STATISTIC_NUM_SLOTS]; int numnumbers[STATISTIC_NUM_SLOTS];
float4 *stanumbers[STATISTIC_NUM_SLOTS]; int numvalues[STATISTIC_NUM_SLOTS];
Datum *stavalues[STATISTIC_NUM_SLOTS];
/* *ThesefieldsareprivatetothemainANALYZEcodeandshouldnotbe *lookedatbytype-specificfunctions.
*/ int tupattnum; /* attribute number within tuples */
HeapTuple *rows; /* access info for std fetch function */
TupleDesc tupDesc;
Datum *exprvals; /* access info for index fetch function */ bool *exprnulls; int rowstride;
} VacAttrStats;
/* flag bits for VacuumParams->options */ #define VACOPT_VACUUM 0x01 /* do VACUUM */ #define VACOPT_ANALYZE 0x02 /* do ANALYZE */ #define VACOPT_VERBOSE 0x04 /* output INFO instrumentation messages */ #define VACOPT_FREEZE 0x08 /* FREEZE option */ #define VACOPT_FULL 0x10 /* FULL (non-concurrent) vacuum */ #define VACOPT_SKIP_LOCKED 0x20 /* skip if cannot get lock */ #define VACOPT_PROCESS_MAIN 0x40 /* process main relation */ #define VACOPT_PROCESS_TOAST 0x80 /* process the TOAST table, if any */ #define VACOPT_DISABLE_PAGE_SKIPPING 0x100 /* don't skip any pages */ #define VACOPT_SKIP_DATABASE_STATS 0x200 /* skip vac_update_datfrozenxid() */ #define VACOPT_ONLY_DATABASE_STATS 0x400 /* only vac_update_datfrozenxid() */
/* *ParameterscustomizingbehaviorofVACUUMandANALYZE. * *NotethatatleastoneofVACOPT_VACUUMandVACOPT_ANALYZEmustbeset *inoptions. * *WhenaddinganewVacuumParammember,consideraddingittovacuumdbas *well.
*/ typedefstruct VacuumParams
{
bits32 options; /* bitmask of VACOPT_* */ int freeze_min_age; /* min freeze age, -1 to use default */ int freeze_table_age; /* age at which to scan whole table */ int multixact_freeze_min_age; /* min multixact freeze age, -1 to
* use default */ int multixact_freeze_table_age; /* multixact age at which to scan
* whole table */ bool is_wraparound; /* force a for-wraparound vacuum */ int log_min_duration; /* minimum execution threshold in ms at *whichautovacuumislogged,-1touse
* default */
VacOptValue index_cleanup; /* Do index vacuum and cleanup */
VacOptValue truncate; /* Truncate empty pages at the end */
Oid toast_parent; /* for privilege checks when recursing */
/* *VacDeadItemsInfostoressupplementalinformationfordeadtupleTID *storage(i.e.TidStore).
*/ typedefstruct VacDeadItemsInfo
{
size_t max_bytes; /* the maximum bytes TidStore can use */
int64 num_items; /* current # of entries */
} VacDeadItemsInfo;
/* GUC parameters */ extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for PostGIS */ extern PGDLLIMPORT int vacuum_freeze_min_age; extern PGDLLIMPORT int vacuum_freeze_table_age; extern PGDLLIMPORT int vacuum_multixact_freeze_min_age; extern PGDLLIMPORT int vacuum_multixact_freeze_table_age; extern PGDLLIMPORT int vacuum_failsafe_age; extern PGDLLIMPORT int vacuum_multixact_failsafe_age; extern PGDLLIMPORT bool track_cost_delay_timing; extern PGDLLIMPORT bool vacuum_truncate;
/* In postmaster/autovacuum.c */ externvoid AutoVacuumUpdateCostLimit(void); externvoid VacuumUpdateCosts(void);
/* in commands/vacuumparallel.c */ extern ParallelVacuumState *parallel_vacuum_init(Relation rel, Relation *indrels, int nindexes, int nrequested_workers, int vac_work_mem, int elevel,
BufferAccessStrategy bstrategy); externvoid parallel_vacuum_end(ParallelVacuumState *pvs, IndexBulkDeleteResult **istats); extern TidStore *parallel_vacuum_get_dead_items(ParallelVacuumState *pvs,
VacDeadItemsInfo **dead_items_info_p); externvoid parallel_vacuum_reset_dead_items(ParallelVacuumState *pvs); externvoid parallel_vacuum_bulkdel_all_indexes(ParallelVacuumState *pvs, long num_table_tuples, int num_index_scans); externvoid parallel_vacuum_cleanup_all_indexes(ParallelVacuumState *pvs, long num_table_tuples, int num_index_scans, bool estimated_count); externvoid parallel_vacuum_main(dsm_segment *seg, shm_toc *toc);
/* in commands/analyze.c */ externvoid analyze_rel(Oid relid, RangeVar *relation,
VacuumParams *params, List *va_cols, bool in_outer_xact,
BufferAccessStrategy bstrategy); externbool std_typanalyze(VacAttrStats *stats);
/* in utils/misc/sampling.c --- duplicate of declarations in utils/sampling.h */ externdouble anl_random_fract(void); externdouble anl_init_selection_state(int n); externdouble anl_get_next_S(double t, int n, double *stateptr);
#endif/* VACUUM_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.