Re: Avoiding sequential scans with OR join condition

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Avoiding sequential scans with OR join condition
Дата
Msg-id 20041018141939.GA21047@wolff.to
обсуждение исходный текст
Ответ на Re: Avoiding sequential scans with OR join condition  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
On Sun, Oct 17, 2004 at 03:30:32 -0400,
  Mike Mascari <mascarm@mascari.com> wrote:
>
> I'm thinking that the WHERE clauses condition should read:
>
> WHERE l1.p_pkey is not null OR l2.p_key is not null;

That seems to make more sense. I was puzzling about that condition myself.
If both keys where not null, there wouldn't even be a need for "left" joins.

Note that the output is different than you were originally getting as
well, since previously rows looked like one big table row combined with
one little table row. Now you are getting one big table row combined with
two little table rows (one of which might be null). This is probably
still faster, but you will need to change how you use the output.

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

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: 8.0.0beta3 vacuum analyze
Следующее
От: "Lada 'Ray' Lostak"
Дата:
Сообщение: Online system & transactions