X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 88C5252D91 for ; Fri, 13 May 2005 12:24:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59110-03 for ; Fri, 13 May 2005 15:24:36 +0000 (GMT) Received: from mail.liquidcore.com (mail.liquidcore.net [68.17.96.60]) by svr1.postgresql.org (Postfix) with ESMTP id 252CB52A55 for ; Fri, 13 May 2005 12:24:34 -0300 (ADT) Received: (from root@localhost) by mail.liquidcore.com (8.13.1/8.12.10) id j4DFOgXw027470; Fri, 13 May 2005 10:24:42 -0500 Received: from [192.168.0.81] (ppasalalinux.nqadmin.com [192.168.0.81]) by mail.liquidcore.com (8.13.1/8.12.10) with ESMTP id j4DFOf61027436; Fri, 13 May 2005 10:24:41 -0500 Message-ID: <4284C779.9090500@nqadmin.com> Date: Fri, 13 May 2005 10:27:53 -0500 From: Prasanth Reply-To: dbadmin@nqadmin.com User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-admin@postgresql.org Subject: Re: using greater than or less than vs equals in where condition References: <4283DD2A.10007@nqadmin.com> <19398.1115953945@sss.pgh.pa.us> In-Reply-To: <19398.1115953945@sss.pgh.pa.us> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-scanner: scanned for malicious content X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200505/185 X-Sequence-Number: 17614 Yes most of the data has type_code =2 probably 99.9%. Thanks, -Prasanth. Tom Lane wrote: > Prasanth 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 > >