Re: [GENERAL] or kills performance

2005-08-31 Thread Tom Lane
Sim Zacks [EMAIL PROTECTED] writes: The parenthesis are correct: where a.batchid=382 and e.stock0 and e.ownerid=1 and ( (d.leadfree and leadstateid in (1,3) ) or (not d.leadfree and leadstateid in (2,3,4) ) ) [ goes back and looks more closely ] The row count estimates in

Re: [GENERAL] or kills performance

2005-08-31 Thread Sim Zacks
I am using autovacuum, and I assumed it was working correctly. Is there a way to tell if it is not doing what it is supposed to? This is the result of ps for the autovacuum PID. The docs say that it should automatically analyze. PID TTY STAT TIME COMMAND 10184 ?Ss 0:32

Re: [GENERAL] or kills performance

2005-08-30 Thread Tom Lane
Sim Zacks [EMAIL PROTECTED] writes: Does it make sense for a simple or in a where clause to kill performance? Did you get the parenthesization correct? Remember that AND binds more tightly than OR. regards, tom lane ---(end of

Re: [GENERAL] or kills performance

2005-08-30 Thread Sim Zacks
My goal is a specific batchid, stock0, ownerid=1 and either leadfree with a state of 1 or 3 OR not leadfree with a state of 2,3 or 4 The parenthesis are correct: where a.batchid=382 and e.stock0 and e.ownerid=1 and ( (d.leadfree and leadstateid in (1,3) ) or (not d.leadfree and