Josh Berkus <josh@agliodbs.com> writes:

> Greg,
> 
> > Or something like that. It might require breaking random_page_cost into two
> > or three different parameters that would normally have the same cost but
> > aren't handled the same, like random_heap_cost, random_leaf_cost, and
> > random_nonleaf_cost.
> 
> Gods forbid.   People don't know how to use random_page_cost as it is; how 
> are 
> they going to handle having 5 different parameters?

Well I wasn't anticipating actually exposing each of these parameters as
separate guv variables. I was anticipating having each of them have the same
cost, but possibly be treated differently by outer plan nodes. For instance a
nested loop iterating an inner node 100 times with those three costs estimated
at <20,15,10> instead of calculating estimated cost of <2000,1500,1000> it can
calculate <2000,150,10> -- discounting leaf page accesses by 90% and nonleaf
pages by 99% but not discounting heap accesses at all.

When the time comes to calculating a single total cost (either for the final
plan to display with EXPLAIN or for a decision picking between alternate
plans) all three might be costed equally using a single random_page_cost guc.

-- 
greg


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to