pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Smet <guillaume.smet@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Estimation problem with a LIKE clause containing a /
Date: Wed, 7 Nov 2007 17:52:16 +0100
Message-ID: <1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com> (raw)
In-Reply-To: <17767.1194453292@sss.pgh.pa.us>
References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com>
	<17767.1194453292@sss.pgh.pa.us>

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



view thread (21+ messages)  latest in thread

Message-ID: <1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com>
Permalink:  ../1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: guillaume.smet@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Estimation problem with a LIKE clause containing a /
  In-Reply-To: <1d4e0c10711070852hfc8aaf2o6eb0cdace2efc9b5@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox