Re: Forcing query to use an index

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Michael Nachbaur <mike(at)nachbaur(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Forcing query to use an index
Date: 2003-03-03 23:21:48
Message-ID: 200303031521.48013.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Micheal,

Don't forget to run ANALYZE as well; this does not require a table lock.

> Does using "set enable_seqscan = off" impact anything else on the
> system, or is it connection-specific? Is this the recommended way of
> doing this, or is there another way of coercing Postgres into using
> indexes? I'm making these queries from Perl code running in an XSP
> page, so I'm not sure how flexible this option would be from a
> developer point of view.

Setting enable_seqscan=off is just for testing purposes, to see if the planner
is making a wrong decision so that you can adjust your .conf params, query,
and/or indexes to suit. The setting is *not* intended as a production
solution.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Nachbaur 2003-03-03 23:27:34 Re: Forcing query to use an index
Previous Message Michael Nachbaur 2003-03-03 22:46:52 Re: Forcing query to use an index