Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 33A569FCB8C; Thu, 8 Nov 2007 19:11:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 68984-09; Thu, 8 Nov 2007 19:10:53 -0400 (AST) Received: from oxford.xeocode.com (unknown [87.127.95.196]) by postgresql.org (Postfix) with ESMTP id 0B4D19FCB8A; Thu, 8 Nov 2007 19:10:53 -0400 (AST) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1IqGWQ-0001t5-4e; Thu, 08 Nov 2007 23:10:50 +0000 To: "Tom Lane" Cc: "Guillaume Smet" , "pgsql-performance" , Subject: Re: Estimation problem with a LIKE clause containing a / In-Reply-To: <27405.1194542548@sss.pgh.pa.us> (Tom Lane's message of "Thu\, 08 Nov 2007 12\:22\:28 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.hackers" 15610) References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com> <17767.1194453292@sss.pgh.pa.us> <11467.1194477248@sss.pgh.pa.us> <1d4e0c10711080208n6c9875b4tf5882da3ced18532@mail.gmail.com> <27405.1194542548@sss.pgh.pa.us> From: Gregory Stark Organization: EnterpriseDB Date: Thu, 08 Nov 2007 23:10:49 +0000 Message-ID: <87prykpc3q.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/117 X-Sequence-Number: 27532 "Tom Lane" writes: > What I am tempted to do about this is have make_greater_string tack "zz" > onto the supplied prefix, so that it would have to find a string that > compares greater than "123/zz" before reporting success. This is > getting pretty klugy though, so cc'ing to pgsql-hackers to see if anyone > has a better idea. Hm, instead of "zz" is there a convenient way to find out what actual character sorts last amongst all the single characters in the locale's encoding? Doesn't really strike at the core reason that this is so klugy though. Surely the "right" thing is to push the concept of open versus closed end-points through deeper into the estimation logic? -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!