Startup cost vs total cost
Also called: startup_cost, total_cost, cost estimate
Every plan node has two cost numbers. Startup cost is the work done before the first row can be returned; total cost is the work to return all rows. EXPLAIN shows them as the cost=0.00..123.45 pair.
What this means
Every plan node carries two cost numbers. Startup cost is the work before the first row can come out; total cost is the work to return them all. A sort has a high startup cost, it must read everything before it can emit even one row. EXPLAIN prints the pair as cost=0.00..123.45.
Why it matters operationally
The two numbers can disagree about which strategy is best. A sort must read everything before emitting a row (high startup), while an ordered index scan can emit immediately (low startup). Under a LIMIT, low startup cost wins, which is why the planner tracks both and why a higher-total-cost path can still be chosen.