X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A4206D1B53D for ; Mon, 13 Oct 2003 23:57:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 63036-06 for ; Mon, 13 Oct 2003 20:57:27 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id BC183D1B553 for ; Mon, 13 Oct 2003 20:57:26 -0300 (ADT) Received: from [216.135.165.74] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3764319; Mon, 13 Oct 2003 16:58:07 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Seth Ladd , pgsql-performance@postgresql.org Subject: Re: ways to force index use? Date: Mon, 13 Oct 2003 16:55:25 -0700 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200310131655.25022.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/438 X-Sequence-Number: 4186 Seth, > The Query: explain analyze select * from path where start =3D 653873 or= =20=20 > start =3D 649967 or stop =3D 653873 or stop =3D 649967 you need to cast all those numbers to BIGINT: select * from path where start =3D 653873::BIGINT or=20=20 start =3D 649967::BIGINT or stop =3D 653873::BIGINT or stop =3D 649967::BIG= INT Then an index on start or stop should be used by the planner. --=20 -Josh Berkus Aglio Database Solutions San Francisco