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

From Guillaume Smet
Subject Re: Estimation problem with a LIKE clause containing a /
Date
Msg-id 1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com
Whole thread Raw
In response to Re: Estimation problem with a LIKE clause containing a /  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Estimation problem with a LIKE clause containing a /
List pgsql-performance
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.

> > Version is PostgreSQL 8.1.8 on i686-redhat-linux-gnu,
>
> You'd probably get better results with 8.2, which has a noticeably
> smarter LIKE-estimator, at least for histogram sizes of 100 or more.

It's not really possible to upgrade this application to 8.2 for now.
It's a very old app based on the thing formerly called as Red Hat WAF
and now known as APLAWS and validating WAF and this application with
8.2 will take quite some time. Moreover the db is big and we can't
afford the downtime of a migration.

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?

Thanks,

--
Guillaume

pgsql-performance by date:

Previous
From: Tom Lane
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 /