Re: Long Running Update - Mailing list pgsql-performance

From Mark Thornton
Subject Re: Long Running Update
Date
Msg-id 4E04889B.2030806@optrak.com
Whole thread Raw
In response to Long Running Update  (Harry Mantheakis <harry.mantheakis@riskcontrollimited.com>)
Responses Re: Long Running Update
Re: Long Running Update
List pgsql-performance
On 23/06/11 16:05, Harry Mantheakis wrote:
> Hello
>
> I am attempting to run an update statement that copies two fields from
> one table to another:
>
>
> UPDATE
>   table_A
> SET
> (
>   field_1
> , field_2
> ) = (
> table_B.field_1
> , table_B.field_2
> )
> FROM
> table_B
> WHERE
> table_B.id = table_A.id
> ;
>

I frequently get updates involving a FROM clause wrong --- the resulting
table is correct but the running time is quadratic. You might want to
try a series of smaller examples to see if your query displays this
behaviour.

Mark Thornton


pgsql-performance by date:

Previous
From: Harry Mantheakis
Date:
Subject: Re: Long Running Update
Next
From: "Kevin Grittner"
Date:
Subject: Re: Long Running Update