classHistograms
final class Histograms
Checks the histogram request of ANALYZE TABLE against the table it names.
Rule: MYSQL-HISTOGRAM-001. A histogram request applies to exactly one table; more than one is HistogramTables. A column name the table's complete shape does not hold, compared under the context's column name comparison, is UnknownHistogramColumn; an open shape (an undeclared table or incomplete members) reports nothing. A bucket count outside 1 to 1024 (MAX_NUMBER_OF_HISTOGRAM_BUCKETS) is BucketCountOutOfRange. Terminates: one pass over the columns and the slots. Source: https://dev.mysql.com/doc/refman/8.4/en/analyze-table.html, https://dev.mysql.com/doc/refman/8.4/en/optimizer-statistics.html. Status: Implemented.
Methods§
public function derive(
Derivation $derivation,
Histogram $histogram,
list<RelationFact> $tables,
): voidReports the problems of a histogram request.
Parameters
$derivation | Derivation | |
$histogram | Histogram | |
$tables | list<RelationFact> | The facts of the tables the statement names, in order |
Called from 1
Calls 7
- method-call Histograms::buckets() line 44
- method-call Derivation::report() line 45
- new BucketCountOutOfRange line 45
- function-call
countline 47 - new HistogramTables line 48
- method-call Histogram::columns() line 56
- new UnknownHistogramColumn line 62
public function buckets(Numeral $buckets): boolTells whether a bucket count is within 1 to 1024.
Parameters
$buckets | Numeral |
Returns
boolTest cases 1
Called from 1
Writes the column names separated by commas.
Called from 3
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\DropHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/DropHistogram.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\LoadHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/LoadHistogram.php:62
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\UpdateHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/UpdateHistogram.php:64
Calls 3
- method-call Output::symbol() line 86
- method-call Output::name() line 88
- class-const NameUse::Column() line 88
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Statement\Server\Maintenance\AnalyzeTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/AnalyzeTable.php:58
- new SqlSemantics\Platform\MySql\Statement\Server\Maintenance\DropHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/DropHistogram.php:60
- new SqlSemantics\Platform\MySql\Statement\Server\Maintenance\LoadHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/LoadHistogram.php:62
- new SqlSemantics\Platform\MySql\Statement\Server\Maintenance\UpdateHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/UpdateHistogram.php:64
Method calls 4
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\AnalyzeTable::deriveStatement() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/AnalyzeTable.php:58
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\DropHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/DropHistogram.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\LoadHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/LoadHistogram.php:62
- method-call SqlSemantics\Platform\MySql\Statement\Server\Maintenance\UpdateHistogram::render() packages/sql-semantics-mysql/src/Statement/Server/Maintenance/UpdateHistogram.php:64