Thread: planner's cost functions

planner's cost functions

From
dafNi zaf
Date:
Hello everybody!

   I'm trying to understand the the query planner's cost estimator.
I was not able to find anywhere the functions that estimate the cost
of each operation that the optimizer produces (via EXPLAIN ANALYZE).

I only found this from for the sequencial scan:
SEQ SCAN = ( cpu_tuple_cost *  rows ) +  ( number of pages * seq_page_cost )

and I am wondering where could I find the rest formulas for the rest operations
(e.g. HashAggregate, Nested Loop, Hash Join, Index Scan, Sort, etc)

I have spent more than three days looking for these but I couldn't find anything.
At least not from the official documentation or other relavant publications

Thank you in advance!
dafNi