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

[GENERAL] reindex table deadlock

2014-11-07 Thread Dan H
Hi, I encountered a deadlock while running 'reindex table TABLE1' in postgresql version 9.2.4 The postgresql logs shows the two offending processes. 1st process was running reindex table TABLE1 waiting for AccessExclusiveLock on primary key index of TABLE1 2nd process was running stored procedur

[GENERAL] Fwd: function for trigger

2014-11-07 Thread avpro avpro
Hi, I have this function CREATE OR REPLACE FUNCTION sumlast_func() RETURNS trigger AS begin CASE WHEN idcar = (select idcar FROM selectedcar) THEN JOIN selectedcar ON selectedcar.idcar = actuals.idcar) update actuals set comb = comb + (select combor from combor_view where idlog = (select max(idlo

Re: [GENERAL] Fwd: function for trigger

2014-11-07 Thread Adrian Klaver
On 11/07/2014 07:07 AM, avpro avpro wrote: Hi, I have this function CREATE OR REPLACE FUNCTION sumlast_func() RETURNS trigger AS begin CASE WHEN idcar = (select idcar FROM selectedcar) THEN JOIN selectedcar ON selectedcar.idcar = actuals.idcar) update actuals set comb = comb + (select combor fr

Re: [GENERAL] Fwd: function for trigger

2014-11-07 Thread David G Johnston
avpro avpro wrote > Hi, > > I have this function > > CREATE OR REPLACE FUNCTION sumlast_func() > RETURNS trigger AS > begin > CASE > WHEN idcar = (select idcar FROM selectedcar) THEN > JOIN selectedcar ON selectedcar.idcar = actuals.idcar) > update actuals > set > comb = comb + (select combor fro

Re: [GENERAL] Testing on Power 8 systems

2014-11-07 Thread Devrim Gündüz
Hi, On Mon, 2014-11-03 at 10:35 -0800, John R Pierce wrote: > oooh, did someone donate a build host?cool! It is not finalized, but we are close to that. > what about AIX ? No idea. I just build RPMs :) Regards, -- Devrim GÜNDÜZ Principal Systems Engineer @ EnterpriseDB: http://www.enterp

Re: [GENERAL] DATA corruption after promoting slave to master

2014-11-07 Thread Shaun Thomas
Krit, It sounds like you might be hitting edge-case statistics problems on recent data. We've had issues with this before, ourselves. I'd personally recommend increasing your default_statistics_target to 400 for your entire database in general. But it's possible that won't help this. Recent dat

Re: [GENERAL] DATA corruption after promoting slave to master

2014-11-07 Thread Kirit Parmar
Hey Shaun, Thanks for quick reply We have not changed the default_statistics_target, so it shall remain to its default value 100. I would like to share our observation on this if you can infer anything from it. : It started using query plan 1 after a our scheduled vacuum run and it continued to