performance : index selection

From: Dmitriy Agafonov <Dmitriy(dot)Agafonov(at)msdw(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: performance : index selection
Date: 2000-12-12 17:54:54
Message-ID: 3A36666E.15DFA49D@msdw.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there any way to specify an index for PostgreSQL to use for a
particular query? My application has to execute a lot of queries like
this : select count(*) from MyTable where IndexedField_1 = value_1 and
IndexedField_2 = value_2 and ... IndexedField_n = value_n

Sometimes Query Planner decides not to use any of the indexes, but that
I can handle by setting enable_seqscan to off.
What's worse is that sometimes a wrong index is used. I know exactly
which index is the best one, because by the time I execute the query I
already have results of all the primitive queries of this kind : select
count(*) from MyTable where IndexedField_i = value_i; (i = 1..n)
Can I somehow let the Query Planner know about it ?

I am pretty sure I can't do this with 7.0.2 , but what about 7.1 ??

Thanks a lot,
Dmitriy Agafonov.

Browse pgsql-general by date

  From Date Subject
Next Message Fernan Aguero 2000-12-12 17:59:06 Re: Large files on linux
Previous Message Carlos Felipe Zirbes 2000-12-12 17:51:57 Foreign Key constraint and Alter Table command