Re: A costing analysis tool - Mailing list pgsql-hackers

From Greg Stark
Subject Re: A costing analysis tool
Date
Msg-id 87d5m5dt7f.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: A costing analysis tool  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: PostgreSQL roadmap for 8.2 and beyond.
Next
From: mark@mark.mielke.cc
Date:
Subject: Re: Question about Ctrl-C and less