Re: [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-07 Thread pbj
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

Re: [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-06 Thread Shaun Thomas
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

Re: [SPAM] - [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-03 Thread pbj
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.

Re: [SPAM] - [GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-03 Thread Igor Neyman
-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

[GENERAL] Performance of UPDATE SET = FROM vs UPDATE SET = (SELECT ...)

2014-11-03 Thread pbj
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

Re: [GENERAL] Performance of update

2008-03-29 Thread sam
On Mar 27, 8:28 am, [EMAIL PROTECTED] ("Albe Laurenz") wrote: > sam wrote: > > Iam trying to update a database table with approx 45000 rows. Iam not > > updating all rows at a time. Iam updating 60 rows at a given time for > > example. and this is happening in a FOR LOOP. A function that has the >

Re: [GENERAL] Performance of update

2008-03-27 Thread Albe Laurenz
sam wrote: > Iam trying to update a database table with approx 45000 rows. Iam not > updating all rows at a time. Iam updating 60 rows at a given time for > example. and this is happening in a FOR LOOP. A function that has the > update statements is called within the loop. > > The updates take too

Re: [GENERAL] Performance of update

2008-03-27 Thread Sam Mason
On Wed, Mar 26, 2008 at 01:26:03PM -0700, Sam wrote: > Iam trying to update a database table with approx 45000 rows. Iam not > updating all rows at a time. Iam updating 60 rows at a given time for > example. and this is happening in a FOR LOOP. A function that has the > update statements is called

Re: [GENERAL] Performance of update

2008-03-27 Thread Volkan YAZICI
On Wed, 26 Mar 2008, sam <[EMAIL PROTECTED]> writes: > Iam trying to update a database table with approx 45000 rows. Iam not > updating all rows at a time. Iam updating 60 rows at a given time for > example. and this is happening in a FOR LOOP. A function that has the > update statements is called

Re: [GENERAL] Performance of update

2008-03-27 Thread Tommy Gildseth
sam wrote: Hi Iam trying to update a database table with approx 45000 rows. Iam not updating all rows at a time. Iam updating 60 rows at a given time for example. and this is happening in a FOR LOOP. A function that has the update statements is called within the loop. The updates take too long..

[GENERAL] Performance of update

2008-03-27 Thread sam
Hi Iam trying to update a database table with approx 45000 rows. Iam not updating all rows at a time. Iam updating 60 rows at a given time for example. and this is happening in a FOR LOOP. A function that has the update statements is called within the loop. The updates take too long.is postgre