From: Mark Thornton <mthornton@optrak.com>
To: Harry Mantheakis <harry.mantheakis@riskcontrollimited.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Long Running Update
Date: Fri, 24 Jun 2011 13:52:43 +0100
Message-ID: <4E04889B.2030806@optrak.com> (raw)
In-Reply-To: <4E035649.20007@riskcontrollimited.com>
References: <4E035649.20007@riskcontrollimited.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mthornton@optrak.com, harry.mantheakis@riskcontrollimited.com
Subject: Re: Long Running Update
In-Reply-To: <4E04889B.2030806@optrak.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox