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

"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



view thread (21+ messages)  latest in thread

Message-ID: <17767.1194453292@sss.pgh.pa.us>
Permalink:  ../17767.1194453292@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17767.1194453292@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, guillaume.smet@gmail.com
  Subject: Re: Estimation problem with a LIKE clause containing a /
  In-Reply-To: <17767.1194453292@sss.pgh.pa.us>

* 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