Re: join removal

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: join removal
Дата
Msg-id 603c8f070908272023x549f9deeib5fc2170e0a7752a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: join removal  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Sun, Aug 16, 2009 at 5:31 PM, Robert Haas<robertmhaas@gmail.com> wrote:
> It seems that the needed checks are very similar to the ones that we
> already implement when setting restrictinfo->mergeopfamilies.  That is
> filled in by get_mergejoin_opfamilies(), which checks for btree
> opfamilies where the strategy number is BTEqualStrategyNumber.  This
> might cease to be the correct check in the (not-too-distant?) future
> if we end up implementing other kinds of unique indices, but right now
> btrees are all there is.
>
> One possibility would be to have relation_is_distinct_for() call
> get_mergejoin_opfamilies() for each operator; then for each index we
> can check whether the opfamily of the relevant index column is in the
> returned list.  This seems a bit wasteful, though, since I believe
> that relation_is_distinct_for() would be called from joinpath.c, which
> has access to restrictinfo->mergeopfamilies already.
>
> I'm wondering whether it would make more sense to modify the proposed
> API for relation_is_distinct_for() in some way so that we don't lose
> this information.

Here is an attempt at the latter approach.  This doesn't actually
remove the join yet; it just checks whether the join can be removed.
I haven't tested it extensively yet, but am hoping for some feedback
on the basic approach.

...Robert

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: patch: Review handling of MOVE and FETCH (ToDo)
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: 8.5 release timetable, again