pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Prasanth <dbadmin@nqadmin.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: using greater than or less than vs equals in where condition
Date: Fri, 13 May 2005 10:27:53 -0500
Message-ID: <4284C779.9090500@nqadmin.com> (raw)
In-Reply-To: <19398.1115953945@sss.pgh.pa.us>
References: <4283DD2A.10007@nqadmin.com>
	<19398.1115953945@sss.pgh.pa.us>

Yes most of the data has type_code =2 probably 99.9%.

Thanks,
-Prasanth.

Tom Lane wrote:
> Prasanth <dbadmin@nqadmin.com> writes:
> 
>>PG Version: 7.4.7
> 
> 
>>explain analyze select * from data where type_code >'2' AND type_code<'4';
>>[ is slow ]
>>explain analyze select * from data where type_code = '3';
>>[ isn't ]
> 
> 
> Are there a whole lot of rows with type_code = 2?  If so, this is
> fixed in 8.0.
> 
> 2003-12-20 20:23  tgl
> 
> 	* src/: backend/access/nbtree/nbtinsert.c,
> 	backend/access/nbtree/nbtpage.c, backend/access/nbtree/nbtsearch.c,
> 	include/access/nbtree.h: Improve btree's
> 	initial-positioning-strategy code so that we never need to step
> 	more than one entry after descending the search tree to arrive at
> 	the correct place to start the scan.  This can improve the behavior
> 	substantially when there are many entries equal to the chosen
> 	boundary value.  Per suggestion from Dmitry Tkach, 14-Jul-03.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 
> 



view thread (3+ messages)

Message-ID: <4284C779.9090500@nqadmin.com>
Permalink:  ../4284C779.9090500@nqadmin.com/
Also on:    postgresql.org/message-id/4284C779.9090500@nqadmin.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: dbadmin@nqadmin.com, tgl@sss.pgh.pa.us
  Subject: Re: using greater than or less than vs equals in where condition
  In-Reply-To: <4284C779.9090500@nqadmin.com>
  References: <4283DD2A.10007@nqadmin.com> <19398.1115953945@sss.pgh.pa.us> <4284C779.9090500@nqadmin.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