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>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Estimation problem with a LIKE clause containing a /
Date: Thu, 08 Nov 2007 12:22:28 -0500
Message-ID: <27405.1194542548@sss.pgh.pa.us> (raw)
In-Reply-To: <1d4e0c10711080208n6c9875b4tf5882da3ced18532@mail.gmail.com>
References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com>
	<17767.1194453292@sss.pgh.pa.us>
	<11467.1194477248@sss.pgh.pa.us>
	<1d4e0c10711080208n6c9875b4tf5882da3ced18532@mail.gmail.com>

"Guillaume Smet" <guillaume.smet@gmail.com> writes:
> On Nov 8, 2007 12:14 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I've applied a patch that might help you:
>> http://archives.postgresql.org/pgsql-committers/2007-11/msg00104.php

> AFAICS, it doesn't seem to fix the problem. I just compiled
> REL8_1_STABLE branch and I still has the following behaviour:

OK, I tried it in fr_FR locale and what I find is that

regression=# select '123/' < '1230'::text;
 ?column? 
----------
 t
(1 row)

so make_greater_string() will still think that its first try at
generating an upper-bound string is good enough.  However

regression=# select '123/1' < '1230'::text;
 ?column? 
----------
 f
(1 row)

so the data starting with '123/' is still outside the generated range,
leading to a wrong estimate.  I didn't see this behavior yesterday but
I was experimenting with en_US which I guess has different rules.

What I am tempted to do about this is have make_greater_string tack "zz"
onto the supplied prefix, so that it would have to find a string that
compares greater than "123/zz" before reporting success.  This is
getting pretty klugy though, so cc'ing to pgsql-hackers to see if anyone
has a better idea.

			regards, tom lane



view thread (21+ messages)  latest in thread

Message-ID: <27405.1194542548@sss.pgh.pa.us>
Permalink:  ../27405.1194542548@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27405.1194542548@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, pgsql-hackers@postgresql.org
  Subject: Re: Estimation problem with a LIKE clause containing a /
  In-Reply-To: <27405.1194542548@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