Re: IN vs EXISTS equivalence

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: IN vs EXISTS equivalence
Дата
Msg-id 471CD1BE.EE98.0025.0@wicourts.gov
обсуждение исходный текст
Ответ на Re: IN vs EXISTS equivalence  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: IN vs EXISTS equivalence  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
>>> On Mon, Oct 22, 2007 at  1:30 PM, in message
<1193077831.4319.61.camel@ebony.site>, Simon Riggs <simon@2ndquadrant.com>
wrote:
> On Mon, 2007-10-22 at 09:31 -0500, Kevin Grittner wrote:
>> I've requested this before without response, but I'm asking again
>> because it just caused me pain again: could we get a TODO added to
>> have the planner recognize equivalent IN and EXISTS constructs and
>> have them compete on cost estimates?  I know it's not a trivial
>> improvement, but if it's on the list maybe someone will pick it up,
>> and I see it as the single biggest weakness in PostgreSQL
>> performance.
>
> I'll pick it up as a default unless someone requests they have it from
> me.
Thanks, Simon.
One more logically equivalent, PostgreSQL-specific form which
costs out even better was suggested off-list:
step=# explain DELETE FROM "Body" USING "Message" WHERE "Message"."bodySeqNo" = "Body"."bodySeqNo";
                     QUERY PLAN 
--------------------------------------------------------------------------------------------------Merge Join
(cost=0.00..696766.20rows=4048543 width=6)  Merge Cond: (("Body"."bodySeqNo")::numeric =
("Message"."bodySeqNo")::numeric) ->  Index Scan using "Body_pkey" on "Body"  (cost=0.00..326108.11 rows=4048543
width=18) ->  Index Scan using "Message_Body" on "Message"  (cost=0.00..310085.16 rows=4048847 width=12) 
(4 rows)
If both of the other syntaxes could compete against that, it would
be fantastic.  (If that's feasible.)
-Kevin




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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: dblink un-named connection doesn't get re-used
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit