pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hilary Forbes <hforbes@dmr.co.uk>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow update
Date: Mon, 12 Sep 2005 10:07:26 -0400
Message-ID: <21152.1126534046@sss.pgh.pa.us> (raw)
In-Reply-To: <5.1.0.14.0.20050912100150.01f47f18@mailserver.dmr.co.uk>
References: <5.1.0.14.0.20050912100150.01f47f18@mailserver.dmr.co.uk>

Hilary Forbes <hforbes@dmr.co.uk> writes:
> I need to set the value of a field in table A to a value in table B depending on the existence of the record in table B.  So what I have done is

> UPDATE tableA set a.val1=b.somefield FROM tableA a, tableB b WHERE a.key1=b.key1;

You've written an unconstrained join to a second copy of tableA.

			regards, tom lane



view thread (18+ messages)  latest in thread

Message-ID: <21152.1126534046@sss.pgh.pa.us>
Permalink:  ../21152.1126534046@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21152.1126534046@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hforbes@dmr.co.uk
  Subject: Re: Slow update
  In-Reply-To: <21152.1126534046@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox