Re: *very* inefficient choice made by the planner (regarding

От: SZUCS Gábor
Тема: Re: *very* inefficient choice made by the planner (regarding
Дата: ,
Msg-id: 008501c4550f$87523a80$0403a8c0@fejleszt4
(см: обсуждение, исходный текст)
Ответ на: *very* inefficient choice made by the planner (regarding IN(...))  (Frank van Vugt)
Ответы: Re: *very* inefficient choice made by the planner (regarding  (Tom Lane)
Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo)
Список: pgsql-performance

Скрыть дерево обсуждения

*very* inefficient choice made by the planner (regarding IN(...))  (Frank van Vugt, )
 Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo, )
 Re: *very* inefficient choice made by the planner (regarding IN(...))  (Tom Lane, )
  Re: *very* inefficient choice made by the planner (regarding IN(...))  (Frank van Vugt, )
 Re: *very* inefficient choice made by the planner (regarding  (Jean-Luc Lachance, )
  Re: *very* inefficient choice made by the planner (regarding  (Tom Lane, )
   Re: *very* inefficient choice made by the planner (regarding  (Jean-Luc Lachance, )
    Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo, )
     Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo, )
 Re: *very* inefficient choice made by the planner (regarding  (SZUCS Gábor, )
  Re: *very* inefficient choice made by the planner (regarding  (Tom Lane, )
  Re: *very* inefficient choice made by the planner (regarding  (Stephan Szabo, )

Dear Gurus,

----- Original Message -----
From: "Stephan Szabo" <>
Sent: Thursday, June 10, 2004 7:14 PM


>
> On Thu, 10 Jun 2004, Stephan Szabo wrote:
>
> >
> > On Thu, 10 Jun 2004, Jean-Luc Lachance wrote:
> >
> > > I agree, but it should be a simple rewrite. No?
> >
> > It's NULLs inside the subselect that are the issue.
> >
> > select 1 in (select a from foo)
> > select exists ( select 1 from foo where a=1)

Just a dumb try :)

  SELECT (exists(select 1 from foo where a isnull) AND NULL)
       OR exists(select 1 from foo where a=1)

AFAIK this returns
* NULL if (NULL in foo.a) and (1 not in foo.a)
* (1 in foo.a) otherwise.

The weakness is the doubled exists clause. I'm sure it makes most cases at
least doubtful...

G.
%----------------------- cut here -----------------------%
\end



В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: *very* inefficient choice made by the planner (regarding
От: Tom Lane
Дата:
Сообщение: Re: Major differences between oracle and postgres performance - what can I do ?