Re: Problem (bug?) with like

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: drheart(at)wanadoo(dot)es, Lista PostgreSql <pgsql-general(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Problem (bug?) with like
Date: 2001-12-04 19:55:30
Message-ID: 200112041955.fB4JtUA26642@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > But what about '%A%' vs. '%AC%'. Seems the second is reasonably
> > different from the first the our optimizer may be fine with that. Is it
> > only when the strings get longer that we lose specificity?
>
> Yeah, I don't think that the estimates are bad for one or two
> characters. But the estimate gets real small real fast as you
> increase the number of match characters in the LIKE pattern.
> We need to slow that down some.

Yea, maybe a log base 2 decrease:

1 char 1x
2 char 2x
4 char 3x
8 char 4x
16 char 5x

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message wsheldah 2001-12-04 20:00:32 Re: Sending Explain output to a perl client
Previous Message Tom Lane 2001-12-04 19:52:19 Re: Problem (bug?) with like

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-12-04 20:07:01 Re: Undocumented feature costs a lot of performance in COPY
Previous Message Tom Lane 2001-12-04 19:52:19 Re: Problem (bug?) with like