Re: [HACKERS] Problem (bug?) with like

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: [HACKERS] Problem (bug?) with like
Дата
Msg-id 3C0D0839.2010102@tm.ee
обсуждение исходный текст
Ответ на Re: Problem (bug?) with like  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-general

Tom Lane wrote:

>Bruce Momjian <pgman@candle.pha.pa.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.
>
Could we just assign weights to first few characters and then consider
only these
first few characters when determinind probabbility of finding it ?

If someone searches for '%New York City%' we have quite good reasons to
believe
that there are some of these in there so we should factor in the fact
that usually one searches
for strings that do exist by said weights.

Another option would be to gather statistics not only on individual
letters but on bi- or
trigraphs. Then as a next step we could implement proper trigraph indexes ;)

----------------
Hannu



В списке pgsql-general по дате отправления:

Предыдущее
От: Laszlo Hornyak
Дата:
Сообщение: Re: java stored procedures
Следующее
От: "Steve Brett"
Дата:
Сообщение: Re: When do I Vacuum ?