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 96587D1B538 for ; Tue, 14 Oct 2003 00:02:25 +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 64193-06 for ; Mon, 13 Oct 2003 21:01:54 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 864E1D1B4EF for ; Mon, 13 Oct 2003 21:01:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9E01thn003744; Mon, 13 Oct 2003 20:01:55 -0400 (EDT) To: Seth Ladd Cc: pgsql-performance@postgresql.org Subject: Re: ways to force index use? In-reply-to: References: Comments: In-reply-to Seth Ladd message dated "Mon, 13 Oct 2003 13:48:15 -1000" Date: Mon, 13 Oct 2003 20:01:55 -0400 Message-ID: <3743.1066089715@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/439 X-Sequence-Number: 4187 Seth Ladd writes: > My Table Columns (all bigints): start, stop, step1, step2, step3 ^^^^^^^^^^^ > The Query: explain analyze select * from path where start = 653873 or > start = 649967 or stop = 653873 or stop = 649967 > Does anyone have a suggestion on how to get that query to use an index? Coerce the constants to bigint, for starters. However, a query that is selecting almost 10% of the table, as your example is, probably *shouldn't* be using an index. regards, tom lane