MERGE: performance advices

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: MERGE: performance advices
Date: 2008-09-02 11:19:34
Message-ID: 20080902131934.473dc97f@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need to merge 2 tables:

update d set c1=s.c1, c2=s.c2... from s where d.pk=s.pk;
insert into d (pk, c1, c2, ...) select pk, c1, c2, c3 from s
where s.pk not in (select pk from d);

Any strategy to make it faster? Including modifying postgres.conf
temporary?

Considering I've no concurrency problems. The tables I'm dealing
with are "read only" for everything else other than the merge
process.

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2008-09-02 11:21:09 Re: plpgsql returning resultset
Previous Message tfinneid 2008-09-02 11:18:44 Re: plpgsql returning resultset