Intent: research — an athletic awards database postgres extended statistics policy defines which multi-column combinations on recognition tables require a CREATE STATISTICS object, which statistic type (ndistinct, dependencies, or MCV) fits each combination, and how to verify that the query planner’s row count estimates improve for reports filtered by season, sport, and award category simultaneously. PostgreSQL collects single-column statistics automatically with ANALYZE and AUTOVACUUM, but when a report’s WHERE clause combines two or three columns that are correlated in the data — award categories that exist only within specific sports, team names that map exclusively to one sport — the planner multiplies each column’s individual selectivity and arrives at a row estimate that can be an order of magnitude too low. Extended statistics capture those multi-column co-occurrence frequencies and give the planner accurate row counts for the combined filter, enabling it to choose the correct join strategy and access method for multi-field recognition reports.
This guide is written for school IT administrators, athletic directors, database administrators, and recognition-program data stewards who maintain PostgreSQL-backed athletic award databases and generate multi-field reports queried by combinations of season, team, sport, and award category. It defines extended statistics in plain terms, explains when the independence assumption causes bad estimates for award queries, provides a column-combination decision table with the correct statistic type for each, gives the creation and verification SQL, and covers how to keep statistics accurate through seasonal import cycles.
The direct answer: create a CREATE STATISTICS object using the mcv type on (season_year, sport, award_category) in your athletic awards table, then run ANALYZE to populate it. Without this object, PostgreSQL’s planner estimates rows for a three-column filter by multiplying each column’s individual selectivity — an assumption that holds only if the columns are independent, which they rarely are in an award database where basketball-specific award categories appear only in basketball rows and spring season awards appear only in spring rows. With an MCV statistics object on that triplet, the planner reads the actual combined frequency of (season_year, sport, award_category) tuples and produces an accurate estimate, selecting the join method and access path appropriate for the true result size rather than the underestimated one.

Digital displays in school hallways draw data from award queries that filter by season, sport, and category simultaneously — extended statistics give the query planner accurate row estimates for those combined filters so it chooses efficient execution paths
What Are Extended Statistics in PostgreSQL?
PostgreSQL’s CREATE STATISTICS command, introduced in PostgreSQL 10, creates a named statistics object that tracks correlations between two or more columns in a single table. Standard single-column statistics — collected automatically for every column by ANALYZE — tell the planner how many distinct values each column has, how often each value appears, and the data distribution across the column’s value range. What they cannot convey is whether a value in column A constrains the likely values of column B.
Three statistic types are available:
ndistinct — Estimates the number of distinct value combinations across the specified columns. The planner uses ndistinct statistics when estimating the result size of GROUP BY operations on multiple columns, or when a WHERE clause filters on those columns without a direct frequency measurement. Available since PostgreSQL 10.
dependencies — Detects functional dependencies: cases where knowing the value of one column allows the planner to predict the value of another with high probability. A typical example is (team_name, sport) — each team name in a school database maps to exactly one sport, so knowing the team name functionally determines the sport. When the planner knows a dependency exists, it adjusts its row estimate for the dependent column’s filter to reflect the constraint the independent column already provides. Available since PostgreSQL 10.
mcv (Most Common Values) — Tracks the most frequent value combinations across the specified columns, storing the actual combined frequency for each tuple. MCV statistics are the most precise of the three types for multi-column WHERE clause estimates because they capture exact co-occurrence data rather than inferring it from individual distributions. Available since PostgreSQL 12.
All three types require an explicit ANALYZE run (or the next AUTOVACUUM ANALYZE cycle) after CREATE STATISTICS before the planner will use the new data. The statistics objects are stored in pg_statistic_ext; the collected data lives in pg_statistic_ext_data.
For programs tracking overall query statistics before and after policy changes, the athletic awards database pg_stat_statements review covers how to baseline and compare query execution metrics — including estimated versus actual row counts — before and after applying extended statistics to a recognition table.
How Single-Column Statistics Fail for Multi-Field Award Reports
PostgreSQL’s query planner estimates the number of rows a WHERE clause will return by calculating the selectivity of each filter condition and multiplying the results. For a single-column filter (WHERE season_year = 2024), this produces an accurate estimate when column statistics are current. For a two- or three-column filter, the planner multiplies the individual selectivities together — a calculation that is mathematically correct only if the columns are statistically independent.
School athletic award databases are structured precisely to be not independent across certain column combinations:
award_categoryvalues such as “Basketball Season MVP” appear only in rows wheresport = 'Basketball'. The two columns are tightly correlated; filtering on both simultaneously does not divide the result set as though they were independent columns.team_name = 'Boys Varsity Basketball'uniquely identifiessport = 'Basketball'. Once the sport is known, filtering on team name adds nearly zero additional selectivity — but the independence assumption multiplies them as though it does.season_yearandaward_dateare strongly correlated: an award granted in the 2024 season has anaward_datein that season’s date range. Filtering on both produces almost no additional restriction over filtering on season alone.
What happens when the estimate is wrong:
Consider a table with 40,000 award records. A report queries for all Spring 2024 Basketball Season Honors. Actual matching rows: 160.
Without extended statistics, the planner calculates:
P(season_year = 2024) = 0.08 (one of ~12 seasons on record)
P(sport = 'Basketball') = 0.14 (one of 7 sports)
P(award_category = 'Season Honors') = 0.25 (one of 4 categories)
Estimated rows: 40,000 × 0.08 × 0.14 × 0.25 = 11 rows
With a three-column MCV statistic on (season_year, sport, award_category), the planner looks up the actual combined frequency of that specific tuple — say 0.004 — and estimates 40,000 × 0.004 = 160 rows. At an estimated 11 rows, the planner chose an index nested-loop scan appropriate for a tiny result set. At an estimated 160 rows, it uses a hash join against athlete profile data. The actual query may run 3–5× faster with the accurate estimate, even though the underlying data did not change.
The independence-assumption problem and the CREATE STATISTICS solution are described in the PostgreSQL extended statistics documentation. The numbers above are illustrative; actual improvement depends on table size, data distribution, and index availability for the specific query.
For programs also managing the BRIN index layer that sits beneath date-range scans on the same award tables, the athletic awards database BRIN index policy covers the complementary question of which date columns qualify for block-range index acceleration — a decision that works alongside extended statistics rather than replacing it.

Every recognition display section showing "2024 Basketball Season Honors" or a similar multi-field slice runs a query filtered on correlated columns — without extended statistics, the planner's row estimate for that query can be off by a factor of ten or more
Decision Table: Which Column Combinations Need Extended Statistics
The following table lists the column combinations most commonly found in school athletic award databases and the recommended statistic type for each. Apply it by identifying which query patterns your multi-field reports actually use — create statistics objects only for combinations that appear in active WHERE clauses.
| Column Combination | Statistic Type | Reason |
|---|---|---|
(season_year, sport, award_category) | mcv | Core three-field report filter; award categories map to specific sports and seasons — high correlation |
(season_year, sport) | ndistinct, mcv | Common two-field slice; season and sport co-vary in nearly every award report |
(sport, award_category) | mcv, dependencies | Award categories are partially dependent on sport; basketball-specific categories appear only in basketball rows |
(team_name, sport) | dependencies | Functional dependency: each team name maps to exactly one sport — knowing team determines sport |
(award_level, award_category) | ndistinct | JV and varsity programs use different award category sets; level and category co-vary by design |
(season_year, award_level) | ndistinct | JV records may span only a subset of seasons in the archive; not independent |
(sport, award_level, award_category) | mcv | Three-field program report: sport + level + category; strongly correlated in schools with separate JV and varsity award tracks |
(team_name, season_year) | ndistinct | Year-over-year team record reports; combination selectivity is lower than the independence assumption predicts |
When to use each type:
mcv— Use when the WHERE clause includes equality filters on all listed columns simultaneously. MCV captures actual combined frequency and is the most precise for equality predicate estimation.dependencies— Use when one column functionally determines another (team → sport). Best for eliminating redundant selectivity calculations on tightly coupled columns.ndistinct— Use when GROUP BY groups on multiple columns, or when equality predicates appear together but MCV coverage is insufficient (the combination has too many distinct values to store efficiently as MCV tuples).
Multiple types can be combined in a single CREATE STATISTICS statement:
CREATE STATISTICS stx_awards_sport_category (ndistinct, mcv)
ON sport, award_category
FROM athletic_awards;
PostgreSQL supports up to eight columns per statistics object. Do not create a single object covering all columns in the table — create targeted objects for the two- and three-column combinations that appear in report WHERE clauses.
Creating Extended Statistics: Commands and Verification
Step 1 — Detect estimate skew before creating statistics
Run EXPLAIN (ANALYZE) on a representative multi-field report query and compare the rows=N estimate in the plan output with the Actual Rows: annotation. A factor-of-10 or greater discrepancy signals a correlation the planner cannot see with single-column statistics.
EXPLAIN (ANALYZE, FORMAT TEXT)
SELECT
athlete_name,
sport,
award_title,
season_year
FROM athletic_awards
WHERE season_year = 2024
AND sport = 'Basketball'
AND award_category = 'Season Honors'
ORDER BY award_title;
Record the rows=N estimate and the Actual Rows: value. This ratio is your before-state baseline.
Step 2 — Create the statistics objects
-- Three-column MCV for the primary multi-field report filter
CREATE STATISTICS stx_awards_season_sport_category (mcv)
ON season_year, sport, award_category
FROM athletic_awards;
-- Two-column ndistinct + MCV for season-by-sport slice queries
CREATE STATISTICS stx_awards_season_sport (ndistinct, mcv)
ON season_year, sport
FROM athletic_awards;
-- Functional dependency for team name and sport
CREATE STATISTICS stx_awards_team_sport (dependencies)
ON team_name, sport
FROM athletic_awards;
-- Three-column MCV for sport + level + category program reports
CREATE STATISTICS stx_awards_sport_level_category (mcv)
ON sport, award_level, award_category
FROM athletic_awards;
Step 3 — Populate the statistics with ANALYZE
ANALYZE athletic_awards;
This step is mandatory. Until ANALYZE runs after CREATE STATISTICS, the objects exist in pg_statistic_ext but contain no data, and the planner continues using the independence assumption for every multi-column filter.
Step 4 — Verify objects are created and populated
-- Confirm objects exist
SELECT
stxname,
stxrelid::regclass AS table_name,
stxkeys,
stxkind
FROM pg_statistic_ext
WHERE stxrelid = 'athletic_awards'::regclass
ORDER BY stxname;
The stxkind column contains an array of characters indicating which types were collected: d for dependencies, f for MCV, n for ndistinct.
To confirm that ANALYZE has populated the data (PostgreSQL 14+):
SELECT
ext.stxname,
dat.stxdndistinct IS NOT NULL AS has_ndistinct,
dat.stxddependencies IS NOT NULL AS has_dependencies,
dat.stxdmcv IS NOT NULL AS has_mcv
FROM pg_statistic_ext ext
JOIN pg_statistic_ext_data dat ON dat.stxoid = ext.oid
WHERE ext.stxrelid = 'athletic_awards'::regclass;
All columns should return true for the types requested. A false in any column means ANALYZE has not yet run since the object was created — run ANALYZE athletic_awards and recheck.

Every category-filtered view on a recognition touchscreen runs a multi-column WHERE clause — extended statistics give the planner the combined frequency data it needs to size the result set accurately and choose the right execution path
Measuring Row Estimate Improvement with EXPLAIN
After creating statistics objects and running ANALYZE, re-run the same EXPLAIN (ANALYZE) query from Step 1. The rows=N figure in the plan output should now be close to the Actual Rows: value.
Before extended statistics (typical output):
Filter: ((season_year = 2024) AND (sport = 'Basketball') AND (award_category = 'Season Honors'))
Rows Removed by Filter: 39840
(rows=11 width=72) (actual rows=160 loops=1)
After extended statistics (typical output):
Filter: ((season_year = 2024) AND (sport = 'Basketball') AND (award_category = 'Season Honors'))
Rows Removed by Filter: 39840
(rows=157 width=72) (actual rows=160 loops=1)
The rows=11 → rows=157 shift is the extended statistics at work: the planner now reads the MCV table for (season_year, sport, award_category) and finds that the specific combination (2024, 'Basketball', 'Season Honors') represents approximately 0.39% of all rows rather than the 0.028% the independence assumption calculated.
What to watch for in the plan after improvement:
- A change from
Nested LooptoHash Joinfor queries that join award records to athlete profiles: the planner now correctly expects enough rows to build a hash table rather than execute repeated index lookups. - The disappearance of a selective
Index Scanin favor of aBitmap Heap ScanorSeq Scan: when the planner estimated 11 rows it used an index; now that it expects 160, it recalculates whether the index traversal cost is justified. - A shift in join order for queries that join three or more tables: accurate row estimates on the outer table determine which table drives the join, and a correct outer-table estimate produces a more efficient nested strategy.
For programs tracking plan changes systematically, the athletic awards database query plan regression checklist provides a framework for baselining plan output before policy changes and detecting regressions after schema updates or bulk imports that might reset plan choices.
See Multi-Field Award Reports Without the Planner Tuning
Rocket Alumni Solutions provides school athletic directors with a cloud-based recognition platform where season-by-sport award reports return accurate, fast results with no extended statistics configuration, no ANALYZE scheduling, and no EXPLAIN ANALYZE required from school IT staff. Request a demo to see filtered recognition views in action.
Request a DemoWhat Extended Statistics Cannot Do
A complete athletic awards database postgres extended statistics policy must document the limits alongside the capabilities.
Extended statistics improve estimates — they do not accelerate queries by themselves. Better estimates lead to better plan choices, and better plans lead to faster execution. But extended statistics do not create indexes, cache data, or change data access paths directly. If the chosen plan after statistics improvement is still a sequential scan due to table size or index availability, extended statistics confirm that the sequential scan is the correct choice — they do not produce a faster alternative on their own.
Extended statistics require ANALYZE to stay current. After a large seasonal import adds new rows, existing MCV statistics no longer reflect the updated value distributions. Until ANALYZE runs, the planner uses stale combined frequencies that may underestimate rows for newly added season-sport-category combinations. High-volume import windows should include an explicit ANALYZE athletic_awards step after the import completes.
Extended statistics on more than three columns have diminishing returns. For a five-column WHERE clause, a five-column MCV object stores the combined frequency of every five-column tuple combination — a combinatorial expansion that produces a large statistics object with marginal additional accuracy over a three-column object covering the most selective predicates. Focus on two- and three-column combinations that dominate active report query shapes.
Extended statistics do not substitute for a covering index on display-critical queries. A touchscreen recognition display that retrieves (athlete_name, award_title, season_year) for a specific (sport, award_category) combination benefits from a covering index that serves the query without touching the table heap. Extended statistics improve the planner’s decision about whether to use that covering index — but the index itself must exist separately. The athletic awards database covering index policy covers which display-critical query patterns justify covering index maintenance alongside extended statistics.
After Each Import: Keeping Extended Statistics Current
Extended statistics are populated at ANALYZE time and stored as a snapshot of the table’s data distribution. They do not update incrementally as rows are inserted. A seasonal import of 2,000 new award records introduces new (season_year, sport, award_category) combinations that the existing MCV table does not yet include. Until the next ANALYZE, the planner treats those new combinations by falling back to the independence assumption for unrecognized tuples — which may underestimate result size if the new season’s award volumes differ significantly from prior seasons.
Recommended import workflow step:
Add an explicit ANALYZE call to the end of every seasonal import procedure, immediately after the bulk INSERT or COPY completes:
-- After bulk INSERT or COPY completes
ANALYZE athletic_awards;
-- Confirm all statistics objects are populated
SELECT ext.stxname
FROM pg_statistic_ext ext
WHERE ext.stxrelid = 'athletic_awards'::regclass
AND NOT EXISTS (
SELECT 1
FROM pg_statistic_ext_data dat
WHERE dat.stxoid = ext.oid
AND dat.stxdmcv IS NOT NULL
);
If this query returns any rows, the named statistics objects lack MCV data — the ANALYZE may have been blocked by a conflicting lock. Re-run ANALYZE athletic_awards and recheck before processing the next report run.
For programs that configure autovacuum around athletic award import windows, athletic awards database autovacuum policy covers how to tune autovacuum to prioritize recognition tables during import season so that extended statistics are refreshed promptly without relying solely on manual intervention after each batch.
For programs exporting award data to external display systems as part of end-of-season reporting — where export correctness depends on the same multi-field queries that extended statistics improve — athletic archive database export checklist covers the verification steps that confirm exported records match multi-field filter expectations before the export reaches the display platform.
For programs that surface award data through digital showcase systems where query speed directly affects visitor experience, best ways to showcase athletic achievement awards digitally describes the display formats and interaction patterns that depend on fast, accurate multi-field queries returning consistent results on every page load.
Integrating Extended Statistics with the Broader Query Governance Framework
An athletic awards database postgres extended statistics policy is one component in a layered query performance governance framework. It works alongside, but does not replace, the other policies that govern how recognition reports execute correctly across import cycles, concurrent display sessions, and schema changes.
Relationship to pg_stat_statements. The pg_stat_statements extension tracks cumulative estimated and actual row counts for each query fingerprint. After applying extended statistics, the ratio of (sum of estimated rows) / (sum of actual rows) for multi-field report query fingerprints should converge toward 1.0. A ratio that remains far from 1.0 after extended statistics are applied signals either a stale ANALYZE (run it manually) or that the statistics object does not cover the exact column combination in the query’s WHERE clause. The athletic awards database pg_stat_statements review covers the query fingerprint analysis that identifies which multi-field patterns remain poorly estimated after extended statistics are in place.
Relationship to work_mem policy. Extended statistics and sort memory policy address different problems. Extended statistics fix the planner’s estimate of how many rows a filter returns. Sort memory (work_mem) governs how much memory is available once those rows are retrieved and sorted. They are complementary: accurate estimates help the planner decide whether to sort at all and which sort strategy to use, while adequate work_mem ensures the chosen sort completes in memory rather than spilling to disk. The athletic awards database work_mem policy for leaderboard sorts describes the sort memory side of the same query performance picture.
Annual statistics review. Extended statistics should be reviewed after the end of each recognition year:
- Run
EXPLAIN (ANALYZE)on each standard multi-field report query shape and confirm estimated rows remain close to actual rows. - Check
pg_statistic_extfor objects whose column combinations no longer appear in active report queries — drop unused objects to reduceANALYZEoverhead. - Add statistics objects for any new report column combinations introduced by schema changes or new display features added during the year.

Team history screens filtered by sport and season rely on accurate planner estimates — a statistics object covering the sport-season combination ensures the query planner sizes the result set correctly and selects an efficient access path for every display refresh
For programs managing recognition data showcased across digital display formats — where accurate data retrieval and fast query response determine the quality of the visitor experience — best ways to showcase athletic achievement awards digitally covers the display format and interaction context in which database query performance is most visible to students, families, and visitors.
For programs considering how to structure athletic achievement data for digital showcase platforms — including the query and export patterns that extended statistics help optimize — showcasing athletic achievement awards digitally: a guide covers the display-side patterns that depend on efficient multi-field database queries returning accurate, consistent results.
Frequently Asked Questions
What are PostgreSQL extended statistics and when were they introduced?
PostgreSQL extended statistics are named objects created with CREATE STATISTICS that capture correlations between two or more columns in a single table. Standard single-column statistics, collected automatically by ANALYZE, allow the planner to estimate how many rows a single-column WHERE clause will return. Extended statistics extend that capability to multi-column predicates by tracking one of three relationship types: ndistinct (the number of distinct value combinations across columns), dependencies (functional dependencies where one column's value predicts another's), or mcv (the actual frequency of the most common value combinations across the listed columns). Extended statistics were introduced in PostgreSQL 10 for ndistinct and dependencies, and in PostgreSQL 12 for MCV. They must be created explicitly with CREATE STATISTICS for each column combination that matters — they are not automatically collected for all pairs.
Why does the query planner produce bad row estimates for multi-field award report queries?
PostgreSQL's query planner estimates row counts for multi-column WHERE clauses by multiplying each column's individual selectivity — the independence assumption. This is mathematically correct only when the columns are statistically unrelated. In athletic award databases, key columns are deliberately correlated: award categories map to specific sports (basketball-specific awards appear only in basketball rows), team names determine sport (each team belongs to one sport), and season awards cluster in specific date ranges. When the planner multiplies these correlated selectivities independently, it consistently underestimates the actual result size. An underestimate causes the planner to choose plans appropriate for tiny result sets — index nested-loop scans — that are slower for the actual 100-row or 200-row result than a hash join would be. Extended statistics on those column combinations give the planner the actual co-occurrence frequency and eliminate the underestimate.
Which column combinations in an athletic award database most benefit from extended statistics?
The highest-value combinations are those that appear together in WHERE clauses of multi-field recognition reports. For most school athletic databases, three combinations stand out: (season_year, sport, award_category) — the core three-field report filter, where all three columns are correlated and a three-column MCV statistic produces the largest estimate improvement; (sport, award_category) — a two-field combination where award categories are partially dependent on sport, making an mcv or dependencies statistic effective; and (team_name, sport) — where a functional dependency statistic captures the fact that team name determines sport, preventing double-counting of selectivity when both columns appear in a WHERE clause. Create statistics objects for the combinations that actually appear in your specific report queries rather than speculatively covering all possible pairs — each object adds overhead to every ANALYZE run.
How do I confirm that extended statistics improved my query plan?
Run EXPLAIN (ANALYZE, FORMAT TEXT) on the multi-field report query before creating extended statistics and record the rows=N estimate and the Actual Rows value from the plan output. After creating the statistics objects and running ANALYZE, run the same EXPLAIN ANALYZE again. The rows=N estimate should now be close to the Actual Rows value — typically within a factor of two rather than a factor of ten or more. Also watch for plan-level changes: a shift from Nested Loop to Hash Join, a change from a targeted index scan to a Bitmap Heap Scan, or a change in join order all indicate that the planner is using the improved estimates to choose a different — and usually more efficient — execution strategy. If the estimate does not improve after ANALYZE, verify that the statistics object covers the exact column combination used in the query's WHERE clause and that pg_statistic_ext_data shows populated data for that object.
Do extended statistics need to be refreshed after a seasonal import?
Yes. Extended statistics are populated by ANALYZE and stored as a snapshot of the table's data distribution at the time of the last ANALYZE run. After a seasonal import adds new award records — new (season_year, sport, award_category) combinations not in the previous snapshot — the existing MCV table does not include those combinations. Until ANALYZE runs again, the planner estimates rows for new combinations by falling back to the independence assumption for unrecognized tuples, which may underestimate their frequency if the new season's award volumes differ from prior seasons. Include an explicit ANALYZE athletic_awards step at the end of every seasonal import procedure, run it immediately after the bulk insert or copy completes, and verify using pg_statistic_ext_data that all statistics objects show populated MCV data before the next multi-field report run is processed.
Conclusion
An athletic awards database postgres extended statistics policy closes the gap between the query planner’s independence assumption and the actual correlated structure of school recognition data. By creating CREATE STATISTICS objects on the two- and three-column combinations that drive multi-field reports — starting with (season_year, sport, award_category) — and running ANALYZE to populate them, IT administrators give the query planner the combined frequency data it needs to select accurate join strategies and access paths for season-by-sport-by-category recognition queries.
The implementation is straightforward: run EXPLAIN (ANALYZE) on a representative multi-field query and observe the ratio of estimated to actual rows, create statistics objects for correlated column pairs and triplets, run ANALYZE, and verify that the estimate ratio improves. Add ANALYZE to the seasonal import workflow to keep statistics current after each award cycle. Review the statistics objects annually to confirm they still match active report query patterns and drop any that no longer serve active queries.
For programs also building a broader athletic recognition database governance framework — covering autovacuum policy, covering indexes, sort memory, and query plan regression monitoring alongside extended statistics — athletic awards: how schools recognize student athletes provides recognition program context, and best ways to showcase athletic achievement awards digitally describes the display-side requirements that make accurate, fast multi-field queries visible to students and visitors.

A student browsing season-and-sport-filtered recognition records on a touchscreen depends on a query that, with extended statistics, selects an accurate execution plan and returns results without unnecessary delay
See Auto-Ranking Award Reports Without Database Configuration
Rocket Alumni Solutions provides school athletic directors with a cloud-based recognition platform where multi-field award reports — filtered by season, sport, and award category — are served from a managed environment with auto-ranking built in. No extended statistics, no ANALYZE scheduling, and no EXPLAIN ANALYZE tuning required from school IT staff. Request a demo to see season-by-sport recognition reports in action.
Request a Free Demo































