Re: Long Running Update

From: Mark Thornton <mthornton(at)optrak(dot)com>
To: Harry Mantheakis <harry(dot)mantheakis(at)riskcontrollimited(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Long Running Update
Date: 2011-06-24 12:52:43
Message-ID: 4E04889B.2030806@optrak.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-06-24 13:43:08 Re: Long Running Update
Previous Message Harry Mantheakis 2011-06-24 12:39:16 Re: Long Running Update