Re: BUG #1325: like error

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: BUG #1325: like error
Дата
Msg-id 20041118061342.D72782@megazone.bigpanda.com
обсуждение исходный текст
Ответ на BUG #1325: like error  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Список pgsql-bugs
On Thu, 18 Nov 2004, PostgreSQL Bugs List wrote:

> select * from tbinvoicerows
> where invoicecd = 'FLOCAA00000025'
>
> result in 0 seconde with 2 records   NO BUG
>
> select * from tbinvoicerows
> where invoicecd like '%FLOCAA00000025%'
>
> result in 40 secondes with 2 records   NO BUG
>
> select * from tbinvoicerows
> where invoicecd like 'FLOCAA00000025%'
>
> result in 40 secondes with 2 records  BUG
> Bug : the result is good but I expect a result faster as the first select
> (like in mssql 7)

To add to the reply already given...

If you're running in "C" locale, the last should be able to use a normal
index on invoicecd.  However, since that didn't appear to happen, either
it's estimating a large number of rows which is unlikely or you are in
some other locale.

For other locales, you may want a pattern_ops index, which would be
something like:
 create index foo on tbinvoicerows(invoicecd varchar_pattern_ops).

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: BUG #1325: like error
Следующее
От: Cao Duy
Дата:
Сообщение: column doesnt exist?