Re: MERGE: performance advices

From: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Steve Clark" <sclark(at)netwolves(dot)com>, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: MERGE: performance advices
Date: 2008-09-02 19:10:15
Message-ID: 396486430809021210g225ce3e5pc4eb7ab8b99a78be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 2, 2008 at 10:58 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com> writes:
>> There is one possible alteration that may or many not improve
>> performance. This would be to replace the EXISTS with a LEFT JOIN
>> WHERE IS NOT NULL;
>
> That changes the behavior, doesn't it? Or is event_log_no a unique
> key for Myevents? I think what you want is to make the EXISTS an IN
> instead.

Thanks for pointing that out Tom. I hadn't consider how the EXISTS
clause would return potentially fewer rows if event_log_no wasn't
unique.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Wilson 2008-09-02 19:14:17 Foreign Key normalization question
Previous Message Jason Long 2008-09-02 18:47:49 Replication setup