Re: [GENERAL] Operator performance question

2007-01-10 Thread Alban Hertroys
Tom Lane wrote: > Alban Hertroys <[EMAIL PROTECTED]> writes: >> My conclusion is that this query time is mostly limited to the somewhat >> complex COUNT expressions. Is there any way to do this more efficiently? > > Offhand I would bet on the bitstring-AND operations being the > bottleneck; you co

Re: [GENERAL] Operator performance question

2007-01-10 Thread Alban Hertroys
Brandon Aiken wrote: > Shouldn't these be using HAVING? > > SELECT COUNT(max_persons) ... > GROUP BY NULL > HAVING max_persons >= 5 AND max_persons <= 8; I don't think so; I need multiple COUNT results for multiple combinations; 5-8 persons isn't the only one. I also need counts for 1-4, 9-12 and

Re: [GENERAL] Operator performance question

2007-01-09 Thread Tom Lane
Alban Hertroys <[EMAIL PROTECTED]> writes: > My conclusion is that this query time is mostly limited to the somewhat > complex COUNT expressions. Is there any way to do this more efficiently? Offhand I would bet on the bitstring-AND operations being the bottleneck; you could test this by comparing

Re: [GENERAL] Operator performance question

2007-01-09 Thread Brandon Aiken
January 09, 2007 11:07 AM To: Postgres General Subject: [GENERAL] Operator performance question Hi all, I need your help on a small performance problem. I have a table of which I have to do a bunch of counts of various conditions. The worst case scenario where I have to iterate over every record i

[GENERAL] Operator performance question

2007-01-09 Thread Alban Hertroys
Hi all, I need your help on a small performance problem. I have a table of which I have to do a bunch of counts of various conditions. The worst case scenario where I have to iterate over every record in the table performs just a little bit too slow (800ms). That particular query will be hit a lo