X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 56D9B4753A1 for ; Mon, 3 Mar 2003 18:21:14 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 31447-01 for ; Mon, 3 Mar 2003 18:21:13 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id D0010474E61 for ; Mon, 3 Mar 2003 18:21:12 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2878183; Mon, 03 Mar 2003 15:21:00 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Michael Nachbaur , Greg Stark Subject: Re: Forcing query to use an index Date: Mon, 3 Mar 2003 15:21:48 -0800 X-Mailer: KMail [version 1.4] Cc: pgsql-sql@postgresql.org References: <06B62341-4DCA-11D7-90E0-000A27935D5A@nachbaur.com> In-Reply-To: <06B62341-4DCA-11D7-90E0-000A27935D5A@nachbaur.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200303031521.48013.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/99 X-Sequence-Number: 12139 Micheal, Don't forget to run ANALYZE as well; this does not require a table lock. > Does using "set enable_seqscan =3D off" impact anything else on the=20 > system, or is it connection-specific? Is this the recommended way of=20 > doing this, or is there another way of coercing Postgres into using=20 > indexes? I'm making these queries from Perl code running in an XSP=20 > page, so I'm not sure how flexible this option would be from a=20 > developer point of view. Setting enable_seqscan=3Doff is just for testing purposes, to see if the pl= anner=20 is making a wrong decision so that you can adjust your .conf params, query,= =20 and/or indexes to suit. The setting is *not* intended as a production=20 solution. --=20 -Josh Berkus Aglio Database Solutions San Francisco