pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gregory Stark <stark@enterprisedb.com>
Cc: 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 19:40:20 -0500
Message-ID: <25287.1194568820@sss.pgh.pa.us> (raw)
In-Reply-To: <87prykpc3q.fsf@oxford.xeocode.com>
References: <1d4e0c10711070453q214f089cpd144cbb5193d3c4f@mail.gmail.com>
	<17767.1194453292@sss.pgh.pa.us>
	<11467.1194477248@sss.pgh.pa.us>
	<1d4e0c10711080208n6c9875b4tf5882da3ced18532@mail.gmail.com>
	<27405.1194542548@sss.pgh.pa.us>
	<87prykpc3q.fsf@oxford.xeocode.com>

Gregory Stark <stark@enterprisedb.com> writes:
> Doesn't really strike at the core reason that this is so klugy though. Surely
> the "right" thing is to push the concept of open versus closed end-points
> through deeper into the estimation logic?

No, the right thing is to take the folk who defined "dictionary sort
order" out behind the barn and shoot 'em ;-).  This has got nothing to
do with open/closed endpoints and everything to do with the bizarre
sorting rules used by some locales.  In particular the reason I want to
append a letter is that some locales discriminate against non-letter
characters in the first pass of sorting.

I did do some experimentation and found that among the ASCII characters
(ie, codes 32-126), nearly all the non-C locales on my Fedora machine
sort Z last and z next-to-last or vice versa.  Most of the remainder
sort digits last and z or Z as the last non-digit character.  Since Z is
not that close to the end of the sort order in C locale, however, z
seems the best bet.

			regards, tom lane



view thread (21+ messages)  latest in thread

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