On Thu, Nov 06, 2014 at 02:55:20PM +, Shaun Thomas wrote:
>
> These updates aren't equivalent. It's very important you know this, because
> you're also inflating your table with a lot of extra updated rows.
>
> Take the first UPDATE:
>
> > UPDATE second SET time1 = orig.time1
> > FROM orig
These updates aren't equivalent. It's very important you know this, because
you're also inflating your table with a lot of extra updated rows.
Take the first UPDATE:
> UPDATE second SET time1 = orig.time1
> FROM orig
> WHERE second.key1 = orig.key1;
If you wrote this as a SELECT, it would look
gsql-general@postgresql.org
> Subject: [SPAM] - [GENERAL] Performance of UPDATE SET = FROM
> vs UPDATE SET = (SELECT ...)
>
> Why does the UPDATE SET = FROM choose a more poorly
> performing plan than the UPDATE SET = (SELECT ...)? It
> seems to me that it is the same join.
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of p...@cmicdo.com
Sent: Monday, November 03, 2014 11:34 AM
To: pgsql-general@postgresql.org
Subject: [SPAM] - [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET
Why does the UPDATE SET = FROM choose a more poorly performing plan than
the UPDATE SET = (SELECT ...)? It seems to me that it is the same join.
I'm using 9.3.5.
CREATE TABLE orig
(
key1VARCHAR(11) PRIMARY KEY,
time1 TIME
);
INSERT INTO orig (key1, time1)
SELECT