CSE Roadmap

Core tier · about 2 hours · 5 parts

Part 3 of 5 · 1 min read

The key fields: scan type, estimated rows, cost

A scan type names the method used; estimated rows and cost quantify how expensive the database expects that method to be.

Think of a shipping quote that states not just "truck" or "plane," but also an estimated weight and price. Two quotes can then be compared on the same terms.

In plain words: the scan type field names the method chosen for one table: a full table scan, reading every row, or an index scan, naming the specific index used. The estimated rows field states how many rows the database expects that step to return, based on its internal statistics about the data. The cost field gives a relative number the database's own optimizer uses internally to compare plans; a lower cost generally means a cheaper plan, but the number's units are only meaningful for comparing within one database's own plans, not across different databases.

A worked example. An execution plan showing Index Scan using idx_orders_customer, estimated rows=12, cost=0.29..8.31 reports an index scan was chosen, expected to return about twelve rows, at a low relative cost.

The key lines. No new SQL; these fields appear directly in the output of the earlier EXPLAIN example.

Scan type, estimated rows, cost

A plan's scan type names the access method chosen for a table (full scan or index scan); estimated rows is the optimizer's predicted row count for that step; cost is a relative number used to compare plans within the same database.

Example: a shipping quote's method, estimated weight, and estimated price are the scan-type, estimated-rows, and cost equivalents for one delivery.