Re: using greater than or less than vs equals in where condition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dbadmin(at)nqadmin(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: using greater than or less than vs equals in where condition
Date: 2005-05-13 03:12:25
Message-ID: 19398.1115953945@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Prasanth <dbadmin(at)nqadmin(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Adam M 2005-05-13 06:28:59 Cannot verify signature of win32 8.0.3 distribution.
Previous Message Prasanth 2005-05-12 22:48:10 using greater than or less than vs equals in where condition