Production engineering
Reveal answer and reasoning
An index is useful in relation to an exact query, not as an abstract performance badge attached to a table. This fixture's composite key begins with category and continues with price and identifier, matching equality on category followed by stable ordering. Selecting only values present in that index can produce a covering access in SQLite. The lesson executes the query and EXPLAIN QUERY PLAN rather than implementing a pretend index in the console.
The observed access path belongs to this schema, provider and data fixture; correctness of the ordered result remains a separate invariant even if another plan is chosen later.
A covering plan does not imply that the query is free, that adding more columns is always beneficial or that every category distribution will use the same access path. An index consumes storage and makes writes maintain another structure. Selecting a new column can change whether this particular access is covering. Statistics, provider versions and schema changes can alter planner choices.
Do not turn a successful plan-name assertion for the owned fixture into a cross-engine contract. The application should specify the returned values and ordering independently from the deployment-specific evidence used to investigate its cost. The HTTP plan endpoint is a diagnostic classroom artifact; ordinary catalog clients should not depend on its descriptive plan strings or internal index names.
What a strong answer covers
- The logical companion and actual query return identifiers2,3,1.
- The fixture index begins with category and supports the stated price/id order.
- A provider-specific covering-plan observation is not a universal performance guarantee.
Common pitfall
Treating an index name or covering label as proof of correctness and universal speed.
Follow-up questions
- What happens to the required order when two prices tie?
- How does adding an unindexed projected column change the investigation?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.