classExplainFacts
final class ExplainFacts
Derives the row EXPLAIN returns and checks the options that depend on each other.
Rule: PG-EXPLAIN-ROWS-001. EXPLAIN returns one column named QUERY PLAN that is never NULL. The server reads the FORMAT options in order, so the last one decides: the value xml gives the type xml, json gives json, text and yaml give text, and without the option the format is text. The value is compared exactly as received, an unquoted word already folded to lower case. Diagnostic: a value that is none of the four; the column is then typed as text. Precision: Known. Rule: PG-EXPLAIN-OPTIONS-001. SERIALIZE (release 17) without a value means text, and its value is one of off, none, text and binary, compared exactly. The options WAL, TIMING and SERIALIZE other than off/none require ANALYZE; TIMING is checked only when it is written, because it otherwise follows ANALYZE. ANALYZE and GENERIC_PLAN exclude each other. Each Boolean option is read by PG-UTILITY-OPTION-VALUE-001. Termination: one pass over the options. Source: https://www.postgresql.org/docs/17/sql-explain.html. Status: Implemented.
Methods§
public function rows(Derivation $derivation, list<UtilityOption> $options): QueryFactAnswers the plan row and reports each FORMAT option the server rejects.
Parameters
$derivation | Derivation | |
$options | list<UtilityOption> |
Returns
Called from 1
Calls 11
- class-const Builtin::Text() line 59
- class-const ExplainFacts::TYPES() line 68
- method-call Derivation::report() line 69
- new UtilityProblem line 69
- class-const UtilityProblemKind::UnknownFormat() line 69
- new QueryFact line 75
- new Field line 75
- new OutputSlot line 75
- new Name line 75
- new Known line 75
- class-const Nullability::NotNull() line 75
public function checks(Derivation $derivation, list<UtilityOption> $options): voidReports each SERIALIZE value the server rejects and each combination of options it refuses.
Parameters
$derivation | Derivation | |
$options | list<UtilityOption> |
Called from 1
Calls 12
- new OptionArguments line 85
- method-call OptionArguments::enabled() line 86
- function-call
in_arrayline 87 - method-call OptionRules::known() line 87
- new OptionRules line 87
- class-const ExplainFacts::SERIALIZE() line 91
- method-call Derivation::report() line 92
- new UtilityProblem line 92
- class-const UtilityProblemKind::UnknownFormat() line 92
- method-call OptionRules::find() line 97
- class-const UtilityProblemKind::RequiresAnalyze() line 100
- class-const UtilityProblemKind::GenericPlanWithAnalyze() line 104
Private surface 2§
Implementation details, listed for orientation only.
private const TYPES = ['text' => \SqlSemantics\Platform\PostgreSql\Statement\Type\Descriptor\Builtin:…private const SERIALIZE = ['off', 'none', 'text', 'binary']Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExplainFactsTestcalls
Relations§
Instantiated in 1
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Explain::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Explain.php:67
- method-call SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Explain::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Explain.php:69