classMaintenanceRule
final class MaintenanceRule
Lowers the maintenance commands, EXPLAIN and LOCK.
Rule: PG-MAINTENANCE-LOWER-001. Scope: VacuumStmt, AnalyzeStmt, vacuum_relation, vacuum_relation_list, opt_vacuum_relation_list, ClusterStmt, cluster_index_specification, ReindexStmt, reindex_target_relation, reindex_target_all, opt_reindex_option_list, CheckPointStmt, ExplainStmt, ExplainableStmt, LockStmt, opt_lock, lock_type. Constructors: Vacuum, Analyze, MaintenanceTarget, Cluster, Reindex, Checkpoint, Explain, Lock. The options are lowered by PG-UTILITY-OPTION-LOWER-001; the explained statement by the family that owns it, through the hub. Termination: lists are flattened iteratively; the explained statement is a proper part of the tree. Source: https://www.postgresql.org/docs/17/sql-vacuum.html, https://www.postgresql.org/docs/17/sql-analyze.html, https://www.postgresql.org/docs/17/sql-cluster.html, https://www.postgresql.org/docs/17/sql-reindex.html, https://www.postgresql.org/docs/17/sql-checkpoint.html, https://www.postgresql.org/docs/17/sql-explain.html, https://www.postgresql.org/docs/17/sql-lock.html. Status: Implemented.
Methods§
Lowers a maintenance command, EXPLAIN or LOCK.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 18
- new OptionRule line 94
- new Vacuum line 98
- method-call OptionRule::words() line 98
- class-const OptionSyntax::Words() line 98
- method-call MaintenanceRule::targets() line 98
- method-call OptionRule::options() line 99
- class-const OptionSyntax::Parenthesized() line 99
- new Analyze line 100
- method-call OptionRule::keyword() line 100
- new Cluster line 102
- method-call MaintenanceRule::index() line 102
- new Reindex line 107
- method-call MaintenanceRule::rebuilt() line 107
- method-call MaintenanceRule::reindexOptions() line 107
- class-const ReindexTarget::Schema() line 108
- new Checkpoint line 110
- method-call MaintenanceRule::lock() line 111
- method-call MaintenanceRule::explain() line 112
Lowers ExplainStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 9
- new OptionRule line 124
- new Explain line 127
- method-call MaintenanceRule::explained() line 127
- method-call OptionRule::analyze() line 128
- method-call OptionRule::words() line 128
- method-call OptionRule::word() line 129
- method-call OptionRule::options() line 130
- class-const OptionSyntax::Parenthesized() line 130
- static-call ImplementationGap::production() line 131
Lowers ExplainableStmt through the family that owns the statement.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::explain() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:127
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::explain() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:128
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::explain() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:129
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::explain() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:130
Calls 4
- function-call
in_arrayline 143 - class-const MaintenanceRule::EXPLAINABLE() line 143
- static-call ImplementationGap::production() line 144
- method-call Lowering::statement() line 147
public function targets(Node $list): list<MaintenanceTarget>Lowers opt_vacuum_relation_list; no table is an empty list.
Parameters
$list | Node |
Returns
list<MaintenanceTarget>Throws
ImplementationGap When the production has no ruleCalled from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:98
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:99
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:100
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:101
Calls 3
- static-call ImplementationGap::production() line 164
- method-call Lowering::items() line 167
- new MaintenanceTarget line 172
Lowers cluster_index_specification; no index is null.
Parameters
$specification | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:102
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:103
Calls 1
- static-call ImplementationGap::production() line 190
public function rebuilt(Node $target): ReindexTargetLowers reindex_target_relation or reindex_target_all.
Parameters
$target | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:107
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:109
Calls 2
- class-const MaintenanceRule::REBUILT() line 203
- static-call ImplementationGap::production() line 203
public function reindexOptions(Node $list): list<UtilityOption>Lowers opt_reindex_option_list; no list is empty.
Parameters
$list | Node |
Returns
list<UtilityOption>Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:107
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:108
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Utility\MaintenanceRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/MaintenanceRule.php:109
Calls 3
- method-call OptionRule::options() line 218
- new OptionRule line 218
- static-call ImplementationGap::production() line 220
Lowers the parts of LockStmt; the optional word TABLE is noise.
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- static-call ImplementationGap::production() line 236
- new Lock line 239
- class-const MaintenanceRule::MODES() line 241
Private surface 4§
Implementation details, listed for orientation only.
private const EXPLAINABLE = ['ExplainableStmt: SelectStmt', 'ExplainableStmt: InsertStmt', 'ExplainableStmt…private const MODES = ['lock_type: ACCESS SHARE' => \SqlSemantics\Platform\PostgreSql\Statement\Utili…private const REBUILT = ['reindex_target_relation: INDEX' => \SqlSemantics\Platform\PostgreSql\Statemen…private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
MaintenanceRuleTestcalls