Re: WIP Join Removal

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: WIP Join Removal
Дата
Msg-id 48BC4127.30706@enterprisedb.com
обсуждение исходный текст
Ответ на WIP Join Removal  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: WIP Join Removal  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-patches
Simon Riggs wrote:
> Patch works, but there's a bit I haven't finished yet - checking unique
> indexes.

Did plan invalidation make it safe to rely on the presence of a unique
index for planning decisions?

Couldn't we also do join removal for inner joins, when there's a foreign
key reference that enforces that there's one and only one matching tuple
in the removed table:

SELECT child.data FROM child, parent WHERE child.fkey = parent.pkey

?


> +     /*
> +      * We can now remove join by pulling up child plan from the keeprel.
> +      * This needs to be done considering costs, since its possible for
> +      * a nested inner indexscan plan to be cheaper. So it isn't
> +      * always desirable to remove the join.

Can you elaborate that a bit? I can't imagine a case where we wouldn't
want to remove a join, when we know we can.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: fixing bug in combocid.c
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: rmgr hooks and contrib/rmgr_hook