pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Owen Jacobson <ojacobson@osl.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to force PostgreSQL using an index
Date: Wed, 15 Feb 2006 14:06:55 -0800
Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com> (raw)

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@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Daniel Caune
Sent: Wednesday, February 15, 2006 1:59 PM
To: pgsql-sql@postgresql.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
 



view thread (11+ messages)  latest in thread

Message-ID: <144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com>
Permalink:  ../144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com/
Also on:    postgresql.org/message-id/144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.com

 · 

reply

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-sql@postgresql.org
  Cc: ojacobson@osl.com
  Subject: Re: How to force PostgreSQL using an index
  In-Reply-To: <144D12D7DD4EC04F99241498BB4EEDCC220834@nelson.osl.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