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 →
Also covered in
What to know first
- B-treeA B-tree is a balanced multiway search tree that maintains ordered keys and supports efficient searching, insertion, deletion, and sequential access.
- execution planAn execution plan is a structured representation of intended operations or tasks and their organization for carrying out a query or other task.
- indexingIndexing is the process of assigning or using positions, keys, or lookup structures to identify and access elements or records.
Related concepts
- sequential scancontrasts with · A sequential scan examines items in an ordered sequence one at a time, for example to evaluate a condition or accumulate a result.
- indexinguses · Indexing is the process of assigning or using positions, keys, or lookup structures to identify and access elements or records.
- 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.
- bloom filterused by · A Bloom filter is a space-efficient probabilistic data structure for testing set membership that permits false positives but not false negatives.
Questions about index scan
What is index scan?
An index scan is a database query operation that traverses an index to locate or retrieve records matching query conditions.
Which Manning books explain index scan?
Just Use Postgres!, MongoDB 8.0 in Action, Third Edition and PostgreSQL Mistakes and How to Avoid Them.
What should I know before learning index scan?
Manning books that teach index scan usually introduce B-tree, execution plan and indexing first.
What is the difference between index scan and sequential scan?
An index scan is a database query operation that traverses an index to locate or retrieve records matching query conditions. A sequential scan examines items in an ordered sequence one at a time, for example to evaluate a condition or accumulate a result.
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.


