Re: Fwd: Tricky join and update with same table - Mailing list pgsql-novice

From Luca Ferrari
Subject Re: Fwd: Tricky join and update with same table
Date
Msg-id CAKoxK+6RgG22mh2z0=5NHSdii8hL06HQ4=RWpdGErvPCzJT8-A@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: Tricky join and update with same table  (James David Smith <james.david.smith@gmail.com>)
Responses Re: Fwd: Tricky join and update with same table  (James David Smith <james.david.smith@gmail.com>)
List pgsql-novice
On Fri, Jul 26, 2013 at 4:36 PM, James David Smith
<james.david.smith@gmail.com> wrote:
> Luca sent me an email a short while ago with some code to try however, and
> I'm doing that at the moment. Though it's been running for about 30 minutes
> now and isn't done. Though there are 230,000 rows, so perhaps that isn't
> that surprising after all. Here it is for posterity:
>

Ops...I was supposed to hit the "reply all" button!
Supposing it is working for you, you can at least split the update
into chunks insering a condition on the main query to update only rows
within a certain date range (let's say the most recent ones). That
will tell you if the query is working properly.
That is als the reason why I suggested using a trigger for further
inserts: I was suppsoing you had a lot of data and therefore doing an
update of chunks when the data is inserted does not make you have to
run a very long query.

Luca


pgsql-novice by date:

Previous
From: Michael Swierczek
Date:
Subject: Re: Fwd: Tricky join and update with same table
Next
From: Francisco Leovey
Date:
Subject: Using wildcard for table name ?