Re: Table UPDATE is too slow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron St-Pierre <rstpierre(at)syscor(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Table UPDATE is too slow
Date: 2004-09-01 05:32:08
Message-ID: 1613.1094016728@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

Ron St-Pierre <rstpierre(at)syscor(dot)com> writes:
> Does anyone have some idea on how we can increase speed, either by
> changing the updates, designing the database
> differently, etc, etc? This is currently a big problem for us.

> Other notables:
> The UPDATE is run from a within a function: FOR rec IN SELECT ...LOOP
> RETURN NEXT rec; UPDATE dataTable.....

One point that I don't think was made before: by doing a collection of
updates in this serial one-at-a-time fashion, you are precluding any
possibility of query optimization over the collection of updates. It
might win to dump the update data into a temp table and do a single
UPDATE command joining to the temp table. Or not --- quite possibly not
--- but I think it's something to think about.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gaetano Mendola 2004-09-01 06:03:08 Re: Performance on 7.4 vs 7.2?
Previous Message Suresh Tri 2004-09-01 05:31:34 Re: Overloading '<' operator

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Ryan S. Puncia 2004-09-01 06:42:00 Changing the column length
Previous Message Ron St-Pierre 2004-09-01 00:18:14 Re: Table UPDATE is too slow