From: Greg Stark <gsstark@mit.edu>
To: Martin Sarsale <martin@emepe3.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: seqscan instead of index scan
Date: 30 Aug 2004 16:36:30 -0400
Message-ID: <873c24ics1.fsf@stark.xeocode.com> (raw)
In-Reply-To: <1093889849.1680.83.camel@kadaif>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A748D@Herge.rcsinc.local>
<1093889849.1680.83.camel@kadaif>
Another option here is to use a partial index. You can index on some other
column -- perhaps the column you want the results ordered by where the where
clause is true.
Something like:
create index t_idx on t (name) where c>0 and d>0;
then any select with a matching where clause can use the index:
select * from t where c>0 and d>0 order by name
Could scan the index and not even have to sort on name.
--
greg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: gsstark@mit.edu, martin@emepe3.net
Subject: Re: seqscan instead of index scan
In-Reply-To: <873c24ics1.fsf@stark.xeocode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox