Re: [PERFORM] increase index performance

2009-05-14 Thread Ow Mun Heng
-Original Message- From: Matthew Wakeling [mailto:matt...@flymine.org] On Thu, 14 May 2009, Ow Mun Heng wrote: >> Shouldn't BITMAP indexes come into play? >> >> Does having one index w/ 3 parameters being better than 3 index w/ 3 >> different parameters be better for BITMAP index seeks?

Re: [PERFORM] increase index performance

2009-05-14 Thread Matthew Wakeling
On Thu, 14 May 2009, Ow Mun Heng wrote: Shouldn't BITMAP indexes come into play? Does having one index w/ 3 parameters being better than 3 index w/ 3 different parameters be better for BITMAP index seeks? I'll let someone correct me if I'm wrong, but using a single index that exactly covers y

Re: [PERFORM] increase index performance

2009-05-13 Thread Ow Mun Heng
-Original Message- From: pgsql-performance-ow...@postgresql.org [mailto:pgsql-performance- A much >> better index to answer your query is (city_id, house_id, floor_id) - >> then it can just look up straight away. Instead of the index returning >> 20 rows to check, it will return ju

Re: [PERFORM] increase index performance

2009-05-13 Thread Thomas Finneid
Matthew Wakeling wrote: Thomas, the order of columns in the index matters. The index is basically a tree structure, which resolves the left-most column before resolving the column to the right of it. So to answer your query, it will resolve the city_id, then it will have to scan almost all of t

Re: [PERFORM] increase index performance

2009-05-13 Thread Matthew Wakeling
On Tue, 12 May 2009, Greg Smith wrote: You should test what happens if you reduce the index to just being (city_id,street_id). I think you're missing the point a little here. The point is that Thomas is creating an index on (city_id, street_id, house_id, floor_id) and running a query on (city

Re: [PERFORM] increase index performance

2009-05-13 Thread Thomas Finneid
First off, is there a way to pre-filter some of this data, by a view, temporary table, partitioned indexes or something. Secondly, one of the problems seems to be the size of the data and its index, how can I calulate how much space a particular part of the index needs in memory? maybe I co

Re: [PERFORM] increase index performance

2009-05-12 Thread Greg Smith
On Tue, 12 May 2009, Thomas Finneid wrote: on a database with 260 GB of data and an index size of 109GB on separate raid disks. there are 85 city_ids, 2000 street_ids per city, 20 house_ids per street per city 5 floor_ids per house_ per street per city You shou

[PERFORM] increase index performance

2009-05-12 Thread Thomas Finneid
Hi have the following table (theoretical) table apartment_location ( city_idint, street_id int, house_id int, floor_id int, owner string ... ) index .. ( city_id, street_id, house_id, floor_id ) tablespc indexspace; on a database w