# Estimations of rows scanned from disk for an index scan

When an index is available, the optimizer has to estimate the number of rows that will be scanned from disk.

The accuracy of this estimate depends on the type of query being optimized.

- Queries with a known search condition
  When the exact start and stop conditions are known at compilation time, the optimizer uses the index itself to make a very precise estimate of the number of rows that will be scanned from disk.
- Queries with an unknown search condition
  Queries sometimes have an unknown search condition, such as in the case when the statement's WHERE clause involves dynamic parameters that are known only at execution time and not at compilation time, or when the statement involves a join.

Parent topic: Selectivity and cardinality statistics
Related concepts
Determinations of rows scanned from disk for a table scan
Statistics-based versus hard-wired selectivity
What are cardinality statistics?
Working with cardinality statistics