X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id E42FDCF238 for ; Fri, 11 Jul 2003 17:14:50 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 44560-04 for ; Fri, 11 Jul 2003 14:14:40 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id 35E29CB4CD for ; Fri, 11 Jul 2003 07:50:23 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 2D60E10258; Fri, 11 Jul 2003 06:43:54 -0400 (EDT) Received: from [10.0.2.7] (unknown [10.0.2.7]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 2B18D10257; Fri, 11 Jul 2003 06:43:52 -0400 (EDT) Subject: Re: force the use of a particular index From: Rod Taylor To: Scott Cain Cc: Postgresql Performance In-Reply-To: <1057850280.1451.22.camel@localhost.localdomain> References: <1057850280.1451.22.camel@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aIjvwgwPPR9tkPp6L8lX" Message-Id: <1057920672.46100.149.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 11 Jul 2003 10:51:13 +0000 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/175 X-Sequence-Number: 2468 --=-aIjvwgwPPR9tkPp6L8lX Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2003-07-10 at 15:18, Scott Cain wrote: > Hello, >=20 > I am wondering if there is a way to force the use of a particular index > when doing a query. I have two tables that are pretty big (each >3 > million rows), and when I do a join between them the performance is > generally quite poor as it does not use the indexes that I think it > should use. Here is an example query: Please send the EXPLAIN ANALYZE results for that query with and without sequential scans enabled. set enable_seqscan =3D true; EXPLAIN ANALYZE ; set enable_seqscan =3D false; EXPLAIN ANALYZE ; --=-aIjvwgwPPR9tkPp6L8lX Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/Dpag6DETLow6vwwRAvM9AJ9Az1pie2jtgOkmjDiE9ppLtdkMYwCffzTi CLMhs6t3xg/ukmKWspVgY/I= =CfIy -----END PGP SIGNATURE----- --=-aIjvwgwPPR9tkPp6L8lX--