Re: Running update in chunks? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Running update in chunks?
Date
Msg-id 50FD0AD3.8020808@archonet.com
Whole thread Raw
In response to Running update in chunks?  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Running update in chunks?  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general
On 21/01/13 08:04, Tim Uckun wrote:
> This is the query I am running
>
> update cars.imports i
>      set make_id = md.make_id
>      from cars.models md where i.model_id = md.id;
>
>
> Here is the analyse
Looks like it's the actual update that's taking all the time.
> This query takes fifty seconds on a macbook air with i7 processor and
> eight gigs of RAM and SSD hard drive.  I am using postgres 9.2
> installed with homebrew using the standard conf file.
Can you try a couple of things just to check timings. Probably worth
EXPLAIN ANALYSE.

SELECT count(*) FROM cars.imports i JOIN cars.models md ON i.model_id =
md.id;

CREATE TEMP TABLE tt AS SELECT i.* FROM cars.imports i JOIN cars.models
md ON i.model_id = md.id;

Now the first one should take half a second judging by your previous
explain. If the second one takes 50 seconds too then that's just the
limit of your SSD's write. If it's much faster then something else is
happening.


--
   Richard Huxton
   Archonet Ltd


pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: Running update in chunks?
Next
From: bhanu udaya
Date:
Subject: Re: pg_Restore