Re: add_path optimization

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: add_path optimization
Дата
Msg-id 603c8f070902271938h4e61bec7n2aac3b0c39b32aa8@mail.gmail.com
обсуждение исходный текст
Ответ на Re: add_path optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: add_path optimization
Список pgsql-hackers
Thanks for taking a look at it.

> I first tried just the compare_fuzzy_path_costs() change and really
> couldn't measure any reliable difference.  oprofile output for CVS HEAD
> looks like

Well, there's obviously something different between your case and
mine, because in my query add_path was the #1 CPU hog and it wasn't
close.  I suspect my query had more joins - I'll take a look at yours.

> It gets worse though: add_similar_paths is flat *wrong*.  It compares
> each successive path to only the current cheapest-total candidate,
> and thus is quite likely to seize on the wrong cheapest-startup path.
> I tried fixing its loop logic like so:

Nuts.  That's probably a fatal defect.

> Now, maybe if we could force the compiler to inline
> compare_fuzzy_path_costs we could buy some of that back.  Another
> possibility is to contort add_similar_path some more so that it avoids
> double comparisons so long as cheapest_total and cheapest_startup are
> the same path; I have a feeling that's not going to win much though.

Agreed.

> So it's kind of looking like a dead end from here.  But in any case the
> patch isn't acceptable as-is with that fundamental logic error in
> add_similar_paths, so I'm bouncing it back for rework.

...Robert


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: add_path optimization
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: xpath processing brain dead