Re: Tweaking the planner's heuristics for small/empty tables

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Tweaking the planner's heuristics for small/empty tables
Дата
Msg-id 4E1D6011020000250003F295@gw.wicourts.gov
обсуждение исходный текст
Ответ на Tweaking the planner's heuristics for small/empty tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Tweaking the planner's heuristics for small/empty tables
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Another thing that struck me while looking at the code is that the
> curpages clamp is applied to indexes too, which seems like a
> thinko. A table occupying a few pages wouldn't likely have an
> index as big as the table itself is.
But not zero pages, either.
> So what I'm currently thinking about is a change like this:
>
>             if (curpages < 10 &&
>                 rel->rd_rel->relpages == 0 &&
>                 !rel->rd_rel->relhassubclass &&
>                 rel->rd_rel->relkind != RELKIND_INDEX)
>                 curpages = 10;
Rather than assume ten heap pages and zero index pages, how about
something like:   if (curpages < 10 &&       rel->rd_rel->relpages == 0 &&       !rel->rd_rel->relhassubclass)
curpages= (rel->rd_rel->relkind == RELKIND_INDEX) ? 1 : 10;
 
> This seems like a safe enough change to apply to 9.1.  Going
> forward we might want to change it more, but I think it'd require
> some real-world testing.
I'd be a little nervous about a change which put indexes all the way
to zero without serious testing; otherwise, agreed.
-Kevin


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: WIP: Fast GiST index build
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tweaking the planner's heuristics for small/empty tables