Re: Table UPDATE is too slow - Mailing list pgsql-performance

From Tom Lane
Subject Re: Table UPDATE is too slow
Date
Msg-id 1613.1094016728@sss.pgh.pa.us
Whole thread Raw
In response to Table UPDATE is too slow  (Ron St-Pierre <rstpierre@syscor.com>)
List pgsql-performance
Ron St-Pierre <rstpierre@syscor.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

pgsql-performance by date:

Previous
From: Ron St-Pierre
Date:
Subject: Re: Table UPDATE is too slow
Next
From: "Michael Ryan S. Puncia"
Date:
Subject: Changing the column length