classVacuumChecks
final class VacuumChecks
Checks the option values of VACUUM and the combinations the server refuses.
Rule: PG-VACUUM-OPTIONS-001. PARALLEL takes an integer from 0 to 1024 and must have a value. INDEX_CLEANUP without a value or with auto, compared without regard to case, leaves the choice to the server; any other value must be Boolean. The Boolean options are read by PG-UTILITY-OPTION-VALUE-001; PROCESS_MAIN and PROCESS_TOAST are on unless turned off. The server refuses: BUFFER_USAGE_LIMIT with FULL unless ANALYZE is on; FULL with PARALLEL above 0; a column list without ANALYZE; FULL with DISABLE_PAGE_SKIPPING; FULL with PROCESS_TOAST off; ONLY_DATABASE_STATS with tables, or with any of ANALYZE, FREEZE, FULL, SKIP_LOCKED, DISABLE_PAGE_SKIPPING and SKIP_DATABASE_STATS on. Termination: one pass over the options. Source: https://www.postgresql.org/docs/17/sql-vacuum.html. Status: Implemented.
Methods§
public function check(
Derivation $derivation,
list<UtilityOption> $options,
bool $tables,
bool $columns,
): voidReports each value VACUUM cannot read and each combination of options and tables it refuses.
Parameters
$derivation | Derivation | |
$options | list<UtilityOption> | |
$tables | bool | Whether tables are named |
$columns | bool | Whether a table lists columns |
Called from 1
Calls 18
- new OptionArguments line 51
- method-call VacuumChecks::workers() line 55
- function-call
strtolowerline 56 - method-call OptionArguments::boolean() line 56
- method-call Derivation::report() line 57
- new UtilityProblem line 57
- class-const UtilityProblemKind::NotBoolean() line 57
- method-call OptionArguments::enabled() line 60
- class-const UtilityProblemKind::BufferLimitFull() line 63
- method-call OptionRules::find() line 63
- new OptionRules line 63
- class-const UtilityProblemKind::ParallelFull() line 64
- class-const UtilityProblemKind::ColumnsWithoutAnalyze() line 65
- class-const UtilityProblemKind::PageSkippingFull() line 66
- class-const UtilityProblemKind::ToastFull() line 67
- class-const UtilityProblemKind::DatabaseStatsTables() line 70
- class-const UtilityProblemKind::DatabaseStatsOptions() line 71
- method-call VacuumChecks::combined() line 71
public function workers(Derivation $derivation, UtilityOption $option): intAnswers the number of workers a PARALLEL option asks for, reporting a missing, non-integer or out-of-range value; 0 when there is no valid one.
Parameters
$derivation | Derivation | |
$option | UtilityOption |
Returns
intCalled from 1
Calls 8
- method-call Derivation::report() line 86
- new UtilityProblem line 86
- class-const UtilityProblemKind::ParallelWithoutValue() line 86
- method-call OptionArguments::integer() line 90
- new OptionArguments line 90
- class-const UtilityProblemKind::NotInteger() line 92
- class-const VacuumChecks::WORKERS() line 96
- class-const UtilityProblemKind::ParallelRange() line 97
public function combined(list<UtilityOption> $options): boolTells whether an option ONLY_DATABASE_STATS excludes is on.
Parameters
$options | list<UtilityOption> |
Returns
boolCalled from 1
Calls 3
- new OptionArguments line 112
- class-const VacuumChecks::EXCLUSIVE() line 113
- method-call OptionArguments::enabled() line 114
Private surface 2§
Implementation details, listed for orientation only.
private const EXCLUSIVE = ['analyze', 'freeze', 'full', 'skip_locked', 'disable_page_skipping', 'skip_dat…private const WORKERS = 1024Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
VacuumChecksTestcalls