Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EC7259FCB5D for ; Wed, 7 Nov 2007 19:14:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 46397-02 for ; Wed, 7 Nov 2007 19:13:25 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6FCB29F9277 for ; Wed, 7 Nov 2007 19:14:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lA7NE9cc011468; Wed, 7 Nov 2007 18:14:09 -0500 (EST) To: "Guillaume Smet" cc: pgsql-performance Subject: Re: Estimation problem with a LIKE clause containing a / In-reply-to: <17767.1194453292@sss.pgh.pa.us> References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com> <17767.1194453292@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 07 Nov 2007 11:34:52 -0500" Date: Wed, 07 Nov 2007 18:14:08 -0500 Message-ID: <11467.1194477248@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/85 X-Sequence-Number: 27500 I wrote: > "Guillaume Smet" writes: >> [ bad estimate for LIKE ] > Hmmm ... what locale are you working in? I notice that the range > estimator for this pattern would be "ancestors >= '1062/' AND > ancestors < '10620'", which will do the right thing in C locale > but maybe not so much elsewhere. I've applied a patch that might help you: http://archives.postgresql.org/pgsql-committers/2007-11/msg00104.php regards, tom lane