AW: Like vs '=' bug with indexing

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB
Тема AW: Like vs '=' bug with indexing
Дата
Msg-id 11C1E6749A55D411A9670001FA6879633681E6@sdexcsrv1.f000.d0188.sd.spardat.at
обсуждение исходный текст
Список pgsql-hackers
> I am reposting this because I'm not sure it actually
> made it to the list.

It did make it to the list, but can you give more details whether or which of the 
following you use:--enable-locale ?--enable-multibyte ?LANG=?LC_COLLATE=?

> I have a function to transform text into a
> pseudo-metaphone variable, take this example:

> Here is the problem: Depending on whether there is an
> index or not, 'like' behaves differently. Here is a
> transcript:
> 
> cddbsql=# select song, metatext(song) from cdsongs
> where metatext(song) like metatext('born to run')
> limit 1 ;
>     song     | metatext
> -------------+----------
>  Born To Run | brntorn
> (1 row)
>  
> cddbsql=# create index cdsongs_meta_song on cdsongs
> (metatext(song)) ;
> CREATE
> cddbsql=# select song, metatext(song) from cdsongs
> where metatext(song) like metatext('born to run')
> limit 1 ;
>  song | metatext
> ------+----------
> (0
> rows)

While I do see, that this is bogous, I do not really understand why you 
use like in this case when your metatext function does not return any 
wildcards. A simple = should lead to the same result. Can you check that
with the index in place ? 

Andreas

>       
> 
> This happens in both 7.0 and 7.1.


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

Предыдущее
От: Peter Mount
Дата:
Сообщение: Re: Open 7.1 items
Следующее
От: Magnus Hagander
Дата:
Сообщение: RE: 7.1 question