|< < 49 > >|

Estimating the cost of a plan

Candidate plans are ranked by cost.

Cost estimation relies on:

  • Cost model: Predict the cost of each operator given:
    • The operator's algorithm.
    • The size of the inputs.
    • Ordering of inputs. (Sorted? On what columns?)
    • Include the cost of dealing with temporaries, which may require I/O.

  • Size of operator output:
    • Number of rows
    • Average row width.

|< < 49 > >|