Need help on creating index for a query w/ 4 greater-than conditions

From: Fan Chi Kam <ntb(at)hkstar(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Need help on creating index for a query w/ 4 greater-than conditions
Date: 2000-03-01 01:21:37
Message-ID: Pine.SOL.4.10.10003010918240.4422-100000@imsp234.hkstar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Sawtell 2000-03-01 03:26:24 Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh
Previous Message Elsa Campos 2000-02-29 18:30:47 Help Me!!!!