Re: [HACKERS] Re: Improve OR conditions on joined columns (common star schema problem)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Re: Improve OR conditions on joined columns (common star schema problem)
Дата
Msg-id 31463.1489953251@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: Improve OR conditions on joined columns (common star schema problem)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wrote:
> Consider
>     SELECT count(*)
>     FROM a FULL JOIN b ON (a.id = b.id)
>     WHERE (a.x = 42 OR b.y = 43);
> and suppose that a and b have mutual FK constraints guaranteeing that
> every non-null a.id value has exactly one match in b and vice versa.

Oh, that was sloppy of me.  Join removal depends on unique constraints
not FK constraints.  So actually, this example just requires assuming
that both a.id and b.id are known unique, which is much less far-fetched
than assuming circular FK constraints.
        regards, tom lane



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

Предыдущее
От: Andreas Karlsson
Дата:
Сообщение: Re: [HACKERS] Removing binaries (was: createlang/droplang deprecated)
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] Removing binaries (was: createlang/droplang deprecated)