Re: Estimation problem with a LIKE clause containing a / - Mailing list pgsql-performance

From Tom Lane
Subject Re: Estimation problem with a LIKE clause containing a /
Date
Msg-id 18180.1194454729@sss.pgh.pa.us
Whole thread Raw
In response to Re: Estimation problem with a LIKE clause containing a /  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Responses Re: Estimation problem with a LIKE clause containing a /
List pgsql-performance
"Guillaume Smet" <guillaume.smet@gmail.com> writes:
> On 11/7/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> Sorry for not having mentioned it before. Locale is UTF-8.

I wanted the locale (lc_collate), not the encoding.

> I suppose my best bet is to remove the pg_statistic line and to set
> the statistics to 0 for this column so that the stats are never
> generated again for this column?

That would optimize this particular query and probably pessimize
a lot of others.  I have another LIKE-estimation bug to go look at
today too; let me see if this one is fixable or not.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Guillaume Smet"
Date:
Subject: Re: Estimation problem with a LIKE clause containing a /
Next
From: Tom Lane
Date:
Subject: Re: Estimation problem with a LIKE clause containing a /