Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id B5E282E3184 for ; Sat, 8 Dec 2007 18:09:07 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 53299-06-3 for ; Sat, 8 Dec 2007 18:09:03 -0400 (AST) Received: from ironport2-out.pppoe.ca (ironport2-out.pppoe.ca [206.248.154.182]) by postgresql.org (Postfix) with ESMTP id 8C1522E30D0 for ; Sat, 8 Dec 2007 18:08:56 -0400 (AST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CABukWkfO+Igp/2dsb2JhbACCPzM X-IronPort-AV: E=Sophos;i="4.23,271,1194238800"; d="scan'208,217";a="11099398" Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 08 Dec 2007 17:08:54 -0500 Received: from [206.248.136.41] ([206.248.136.41]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id NIQ73454; Sat, 08 Dec 2007 17:08:54 -0500 Message-ID: <475B159D.8000203@mark.mielke.cc> Date: Sat, 08 Dec 2007 17:07:25 -0500 From: Mark Mielke User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Combining two bitmap scans out performs a single regular index scan? References: <475AD1E8.7000304@mark.mielke.cc> <15505.1197146779@sss.pgh.pa.us> In-Reply-To: <15505.1197146779@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------070400060709080103090105" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/109 X-Sequence-Number: 27925 This is a multi-part message in MIME format. --------------070400060709080103090105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: > Mark Mielke writes: > >> To find records after a certain time, I must do one of: >> select * from icpric where audtdate > ? or (audtdate = ? and >> audttime > ?) >> > In recent releases (at least 8.2, don't remember about 8.1), a row > comparison is what you want: > > WHERE (auddate, adttime) > (?, ?) > Cool! That's the ticket. :-) I guess it would be unnecessary to translate the other two queries into this one for the purpose of planning, eh? :-) Cheers, mark -- Mark Mielke --------------070400060709080103090105 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Tom Lane wrote:
Mark Mielke <mark@mark.mielke.cc> writes:
  
To find records after a certain time, I must do one of:
    select * from icpric where audtdate > ? or (audtdate = ? and 
audttime > ?)
    
In recent releases (at least 8.2, don't remember about 8.1), a row
comparison is what you want:

	WHERE (auddate, adttime) > (?, ?)
  
Cool! That's the ticket. :-)

I guess it would be unnecessary to translate the other two queries into this one for the purpose of planning, eh? :-)

Cheers,
mark
-- 
Mark Mielke <mark@mielke.cc>
--------------070400060709080103090105--