pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Seth Ladd <seth@picklematrix.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: ways to force index use?
Date: Mon, 13 Oct 2003 20:01:55 -0400
Message-ID: <3743.1066089715@sss.pgh.pa.us> (raw)
In-Reply-To: <B6A1D046-FDD7-11D7-A960-000A9576D038@picklematrix.net>
References: <B6A1D046-FDD7-11D7-A960-000A9576D038@picklematrix.net>

Seth Ladd <seth@picklematrix.net> 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



view thread (5+ messages)  latest in thread

Message-ID: <3743.1066089715@sss.pgh.pa.us>
Permalink:  ../3743.1066089715@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3743.1066089715@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, seth@picklematrix.net
  Subject: Re: ways to force index use?
  In-Reply-To: <3743.1066089715@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox