Re: How to force PostgreSQL using an index

From: "Owen Jacobson" <ojacobson(at)osl(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: How to force PostgreSQL using an index
Date: 2006-02-15 22:06:55
Message-ID: 144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

SET SESSION enable_seqscan TO OFF could be interpreted as a strong hint to the server that you want it to use indexes. It's not completely mandatory (the server WILL still do a sequential scan if it has to) but postgresql will strongly prefer index scans. You may also have some luck twiddling the cpu_index_tuple_cost option.

- Owen

(Apologies for the Outlookism.)

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Daniel Caune
Sent: Wednesday, February 15, 2006 1:59 PM
To: pgsql-sql(at)postgresql(dot)org
Subject: [SQL] How to force PostgreSQL using an index

Hi,

Is there a way to force PostgreSQL using an index for a SELECT statement? I just want to confirm that the index PostgreSQL decides to use is better than the index I supposed PostgreSQL would use (I already analyze the table).

Regards,

--
Daniel CAUNE
Ubisoft Online Technology
(514) 4090 2040 ext. 5418

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2006-02-15 22:06:56 Re: How to force PostgreSQL using an index
Previous Message Daniel Caune 2006-02-15 21:58:54 How to force PostgreSQL using an index