<!-- llms-explorer concept facts · https://llms-explorer.com/tree/query-settings-representative-query-backfill-and-fcv-boundaries/ · pack 2026-10-27 · ~941 tokens -->

# Query-settings representative-query backfill and FCV boundaries

> Source-anchored research for Query-settings representative-query backfill and FCV boundaries. Run status: COMPLETED.

Parent: [MongoDB query planner, plan cache, query settings and hints](https://llms-explorer.com/tree/mongodb-query-planner-plan-cache-and-query-settings/) · 3 facets · 9 facts · page: https://llms-explorer.com/tree/query-settings-representative-query-backfill-and-fcv-boundaries/

## How it works

- When setQuerySettings receives a query-shape hash string, representativeQuery is initially absent from $querySettings output; inspection and migration must accommodate entries without that field. (medium confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/v8.3/reference/command/setquerysettings/)
- Backfill is asynchronous and best effort. The first matching execution need not populate representativeQuery; if backfill does not complete, a later matching execution triggers another attempt. (high confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/v8.3/reference/command/setquerysettings/)
- In the inspected master implementation, settings lookup schedules backfill when BackfillCoordinator::shouldBackfill permits it, then returns the query settings. Representative-query upserts use a separate collection and catch DBException failures. (low confidence) (verified as of 2026-10-27) — [source](https://raw.githubusercontent.com/mongodb/mongo/master/src/mongo/db/query/query_settings/query_settings_service.cpp)
- Percona ClusterSync documentation requires manual query-settings migration after replication finalization. It directs users to identify exported settings by representativeQuery when present and queryShapeHash otherwise. (low confidence) (verified as of 2026-08-20) — [source](https://docs.percona.com/percona-clustersync-for-mongodb/pqs.html)

## Problems, failure modes and limitations

- MongoDB 8.3 expands representative-query storage beyond the original 16 MB BSON document limit; this statement concerns representative-query storage capacity, not a general increase to BSON document limits. (medium confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/v8.3/reference/command/setquerysettings/)
- Downgrading to a version without expanded representative-query capacity restores the 16 MB limit and can lose some representative queries. (low confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/release-notes/8.3-compatibility.md)

## Facts and statements

- Automatic representative-query backfill starts in MongoDB 8.3 and requires FCV 8.3 or later; a matching query execution schedules the work without user action. (high confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/v8.3/reference/command/setquerysettings/)
- The inspected MongoDB master interface exposes dedicated representative-query collection creation and upsert methods. Its downgradeQuerySettings contract derives migrations from feature flags enabled at targetFCV; this development-branch interface alone does not establish released-version behavior. (low confidence) (verified as of 2026-10-27) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/query_settings/query_settings_service.h)
- SERVER-129203 describes representativeQuery being stored separately in config.queryShapeRepresentativeQueries under featureFlagPQSBackfill, with insert replies including it and update replies omitting it. The issue was resolved Won't Fix with no fix version; its desired consistent reply is not evidence of shipped behavior. (low confidence) (verified as of 2026-09-08) — [source](https://jira.mongodb.org/browse/SERVER-129203)
