Re: Need Some Explanation of an EXPLAIN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: "Bill Thoen" <bthoen(at)gisnet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Need Some Explanation of an EXPLAIN
Date: 2008-09-26 21:25:00
Message-ID: 27774.1222464300@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> writes:
> On Fri, Sep 26, 2008 at 12:13 PM, Bill Thoen <bthoen(at)gisnet(dot)com> wrote:
>> 2.) How can I make this update faster?

> Get a faster server?

Increasing work_mem might help. If the hashtable size estimate is
right, you'd need something like 100MB to be sure that the join gets
done in only one batch.

Also, if a lot of the rows needn't actually change, it'd be worthwhile
to add a WHERE clause:

UPDATE growers
SET grower_id = id2.grower_id
FROM id2 WHERE growers.fsa_id = id2.fsa_id
AND growers.grower_id != id2.grower_id

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Decibel! 2008-09-26 21:56:55 Re: Is there any way to reliably influence WHERE predicate evaluation ordering?
Previous Message Tom Lane 2008-09-26 21:19:32 Re: Is there any way to reliably influence WHERE predicate evaluation ordering?