pattern-match selectivity code and lower(thing) LIKE

From: Nicholas Piper <nick(at)nickpiper(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: pattern-match selectivity code and lower(thing) LIKE
Date: 2002-01-17 15:20:12
Message-ID: 20020117152012.A4230@piamox7.haus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> On Tue, 07 Aug 2001, Tom Lane wrote:

>> I'm on 7.1
>> (PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.4)

> Okay ... [ looks at code ... ] oh, I see the problem. The pattern-match
> selectivity code doesn't try to deal with &quot;lower(foo) LIKE ...&quot;:

> /*
> * If expression is not var op constant for
> * a simple var of a real relation (no subqueries, for now),
> * then punt and return a default estimate.
> */

> This could probably be improved, but I don't have time to think
> about it now. In the meantime you could try knocking
> DEFAULT_MATCH_SEL down a little bit. (It's already been reduced to
> 0.005 in current sources, in fact.) See
> src/backend/utils/adt/selfuncs.c.

Has this improved any since Aug. ? I tried to look in the current CVS,
but I don't know where this code would be. I did a quick find and
couldn't locate the comment shown above anywhere.

(I've returned to my original project, and tried reducing
DEFAULT_MATCH_SEL in 7.1.3 to 0.005 (it was 0.01 in the current cygwin
source); this didn't help so I'm going to use lowercase only entries
in my tables for now so I don't have to index lower(item)).

Nick

--
Part 3 MEng Cybernetics; Reading, UK http://www.nickpiper.co.uk/
Change PGP actions of mailer or fetch key see website 1024D/3ED8B27F
Choose life. Be Vegan :-) Please reduce needless cruelty + suffering !

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-01-17 15:24:16 Re: pg_dump behaviour changed in 7.1.3?
Previous Message Darren Ferguson 2002-01-17 15:17:19 Re: VARCHAR to INTEGER conversion