pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: ways to force index use?
Date: Tue, 14 Oct 2003 02:20:40 +0200
Message-ID: <3F8B4158.2030600@bigfoot.com> (raw)
In-Reply-To: <3743.1066089715@sss.pgh.pa.us>
References: <B6A1D046-FDD7-11D7-A960-000A9576D038@picklematrix.net>
	<3743.1066089715@sss.pgh.pa.us>

Tom Lane wrote:
> 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.

I think that for 10% is still better and Index scan.
There is around a way to calculate this elbow ?



Regards
Gaetano Mendola




view thread (5+ messages)  latest in thread

Message-ID: <3F8B4158.2030600@bigfoot.com>
Permalink:  ../3F8B4158.2030600@bigfoot.com/
Also on:    postgresql.org/message-id/3F8B4158.2030600@bigfoot.com

 · 

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: mendola@bigfoot.com, pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us
  Subject: Re: ways to force index use?
  In-Reply-To: <3F8B4158.2030600@bigfoot.com>

* 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