Index scan
An index scan is a database query operation that traverses an index to locate or retrieve records matching query conditions.
Just Use Postgres!
An index scan is a database access strategy that retrieves matching table rows through an index rather than examining the entire table.
- How it is used
- Diagnoses query access paths and verifies whether PostgreSQL uses indexes instead of sequential scans.
- How deep it goes
- Explains execution-plan evidence, B-tree ordering, composite-index constraints, and timing, but does not develop planner internals.
- Examples
- Uses player lookups, score ranges, leaderboards, and partitioned heart-rate aggregation queries.
- What you can do after
- Diagnose query plans with EXPLAIN and confirm whether predicates use primary-key, B-tree, composite, or partition-local indexes.
MongoDB 8.0 in Action, Third Edition
An index scan is query execution that traverses index entries to locate documents matching query conditions.
- How it is used
- Locates matching MongoDB records through index entries and helps assess whether a query avoids a collection scan.
- How deep it goes
- Explains IXSCAN in execution plans and statistics, including FETCH and covered queries, without detailing the scan’s internal algorithm.
- Examples
- Uses indexed movie-runtime queries, separately indexed $or clauses, and a covered movie projection with zero documents examined.
- What you can do after
- Diagnose/debug with explain("executionStats") to identify IXSCAN, inspect examined-key and document counts, and spot collection scans.
Read how MongoDB 8.0 in Action, Third Edition explains index scan →
PostgreSQL Mistakes and How to Avoid Them
An index scan is a query execution method that retrieves matching rows by traversing a database index.
- How it is used
- Diagnoses PostgreSQL query performance by connecting predicates, selected columns, and execution plans to index usage.
- How deep it goes
- Explains predicate matching, table reads, and plan inspection, but does not develop broader PostgreSQL planner internals.
- Examples
- Uses timestamped payments, date_trunc predicates, EXPLAIN output, expression indexes, and Python psycopg fetch comparisons.
- What you can do after
- Diagnose index use with EXPLAIN, rewrite timestamp predicates as ranges, and choose narrower projections or matching expression indexes.
Read how PostgreSQL Mistakes and How to Avoid Them explains index scan →
Related concepts
- sequential scancontrasts with · A sequential scan is a search or query operation that examines items in a table or collection in sequence to identify those matching a condition, rather than locating them through an index.
- indexinguses · Indexing is the organization or use of positions, keys, or lookup structures to identify and retrieve selected data or elements.
- composite indexused by · A composite index is a database index whose key contains multiple fields or columns, ordered according to the index definition.
- index fragmentationcontrasts with · Index fragmentation is the condition in which the logical ordering of index pages differs from their physical storage ordering or pages contain inefficiently distributed free space.
- index-only scancontrasts with · An index-only scan is a database access technique that answers a query from index contents without fetching corresponding table rows when visibility permits.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


