Re: [PERFORM] Forcing more agressive index scans for BITMAP AND

2008-04-08 Thread Matthew
On Tue, 8 Apr 2008, Ow Mun Heng wrote: I moved from multicolumn indexes to individual indexes because the queries does not always utilise the same few indexes, some users would use eg: index F, A, B or D,A,E or any other combination. Yes, that does make it more tricky, but it still may be best

Re: [PERFORM] Forcing more agressive index scans for BITMAP AND

2008-04-07 Thread Ow Mun Heng
On Mon, 2008-04-07 at 11:50 +0100, Matthew wrote: > On Mon, 7 Apr 2008, Ow Mun Heng wrote: > > just wondering if there's a special tweak i can do to force more usage > > of indexes to do BITMAP ands? > > There's no need to post this again. You have already had a couple of > useful answers. Sorr

Re: [PERFORM] Forcing more agressive index scans for BITMAP AND

2008-04-07 Thread Matthew
On Mon, 7 Apr 2008, Ow Mun Heng wrote: just wondering if there's a special tweak i can do to force more usage of indexes to do BITMAP ands? There's no need to post this again. You have already had a couple of useful answers. Matthew -- All of this sounds mildly turgid and messy and confusin

Re: [PERFORM] Forcing more agressive index scans for BITMAP AND

2008-04-04 Thread PFC
On Fri, 4 Apr 2008, Ow Mun Heng wrote: select * from table where A=X and B = Y and C = Z and D = AA and E = BB With that kind of WHERE condition, Postgres will use a Bitmap Index Scan to combine your indices. If, however, postgres notices while looking at the statistics gathered during A

Re: [PERFORM] Forcing more agressive index scans for BITMAP AND

2008-04-04 Thread Matthew
On Fri, 4 Apr 2008, Ow Mun Heng wrote: select * from table where A=X and B = Y and C = Z and D = AA and E = BB This may not be the answer you're looking for, but if you create a multi-coloumn index, it should be able to make your query run fast: CREATE INDEX foo ON table (A, B, C, D, E); It