Need help on creating index for a query w/ 4 greater-than conditions - Mailing list pgsql-sql

From Fan Chi Kam
Subject Need help on creating index for a query w/ 4 greater-than conditions
Date
Msg-id Pine.SOL.4.10.10003010918240.4422-100000@imsp234.hkstar.com
Whole thread Raw
List pgsql-sql
What sort of indexing I should use if I try to run the following query?

SELECT part_id  FROM part   WHERE dimen1 >= ? and dimen2 >= ? and dimen3 >= ? and dimen4 >= ?  ORDER BY dimen1, dimen2,
dimen3,dimen4  LIMIT 100;
 

I tried creating index on the dimen1, dimen2, dimen3, and dimen4 columns,
but this dosn't help at all.  The query plan I always get is sorting
followed by a seq scan.

Sort  (cost=2822.86 rows=622 width=96) ->  Seq Scan on part  (cost=2822.86 rows=622 width=96)

Thanks




pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh
Next
From: Elsa Campos
Date:
Subject: Help Me!!!!