Re: Stopgap solution for table-size-estimate updating problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Stopgap solution for table-size-estimate updating problem
Дата
Msg-id 20772.1101516899@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Stopgap solution for table-size-estimate updating problem  ("Zeugswetter Andreas DAZ SD" <ZeugswetterA@spardat.at>)
Ответы Re: Stopgap solution for table-size-estimate updating
Список pgsql-hackers
"Zeugswetter Andreas DAZ SD" <ZeugswetterA@spardat.at> writes:
>> rel->pages = RelationGetNumberOfBlocks(relation);

> Is RelationGetNumberOfBlocks cheap enough that you can easily use it for the
> optimizer ?

It's basically going to cost one extra lseek() kernel call ... per
query, per table referenced in the query.  I no longer think this is
a killer argument.  lseek isn't going to induce any I/O, so it should
be cheap as kernel calls go.

> I myself have always preferred more stable estimates that only change
> when told to. I never liked that vacuum (without analyze) and create index
> change those values, imho only analyze should.

Indeed, this is probably the most significant argument in favor of
leaving things as they are.  But the other side of the coin is: why
shouldn't a bunch of inserts or updates cause the plan to change?
The people who are complaining about it have certainly posted plenty
of examples where it would help to change the plans.

> But I am used to applications
> that prepare a query and hold the plan for days or weeks. If you happen to 
> create the plan when the table is by chance empty you lost.

You lose in either case, since this proposal doesn't change when
planning occurs or doesn't occur.
        regards, tom lane


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

Предыдущее
От: Roland Volkmann
Дата:
Сообщение: Error: column "nsptablespace" does not exist
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error: column "nsptablespace" does not exist