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 17767.1194453292@sss.pgh.pa.us
Whole thread Raw
In response to Estimation problem with a LIKE clause containing a /  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Responses Re: Estimation problem with a LIKE clause containing a /  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Re: Estimation problem with a LIKE clause containing a /  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
"Guillaume Smet" <guillaume.smet@gmail.com> 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.

> 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.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: index stat
Next
From: "Guillaume Smet"
Date:
Subject: Re: Estimation problem with a LIKE clause containing a /