Re: Avoiding bad prepared-statement plans.

Поиск
Список
Период
Сортировка
От Jeroen Vermeulen
Тема Re: Avoiding bad prepared-statement plans.
Дата
Msg-id 4B873665.20208@xs4all.nl
обсуждение исходный текст
Ответ на Re: Avoiding bad prepared-statement plans.  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Avoiding bad prepared-statement plans.  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas wrote:
> On Wed, Feb 17, 2010 at 5:52 PM, Jeroen Vermeulen <jtv@xs4all.nl> wrote:
>> I may have cut this out of my original email for brevity... my impression is
>> that the planner's estimate is likely to err on the side of scalability, not
>> best-case response time; and that this is more likely to happen than an
>> optimistic plan going bad at runtime.
> 
> Interestingly, most of the mistakes that I have seen are in the
> opposite direction.

I guess there's not much we can do about those, except decide after 
running that it's worth optimizing for specific values.


>> Yeb points out a devil in the details though: the cost estimate is unitless.
>>  We'd have to have some orders-of-magnitude notion of how the estimates fit
>> into the picture of real performance.
> 
> I'm not sure to what extent you can assume that the cost is
> proportional to the execution time.  I seem to remember someone
> (Peter?) arguing that they're not related by any fixed ratio, partly
> because things like page costs vs. cpu costs didn't match physical
> reality, and that in fact some attempts to gather better empirically
> better values for things like random_page_cost and seq_page_cost
> actually ended up making the plans worse rather than better.  It would
> be nice to see some research in this area...

Getting representative workloads and machine configurations may make 
that hard.  :/

But all we really want is a check for really obscene costs, as an extra 
stopgap so we don't have to wait for the thing to execute before we 
decide it's too costly.  Surely there must be some line we can draw.


Jeroen


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Why isn't stats_temp_directory automatically created?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: visibility maps and heap_prune