Re: Sigh, LIKE indexing is *still* broken in foreign locales

Поиск
Список
Период
Сортировка
От Giles Lean
Тема Re: Sigh, LIKE indexing is *still* broken in foreign locales
Дата
Msg-id 5852.960497121@nemeton.com.au
обсуждение исходный текст
Ответ на Re: Sigh, LIKE indexing is *still* broken in foreign locales  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы RE: Sigh, LIKE indexing is *still* broken in foreign locales  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
On Thu, 08 Jun 2000 10:04:11 -0400  Tom Lane wrote:

> The bounds do not have to be perfectly tight, in the sense of being
> the least string >= or largest string <= the desired strings.  It's
> OK if we scan a few extra tuples in some cases.  But we have to have
> reasonably close bounds or we can't implement LIKE with an index.

Determining the bounding (sub-)strings looks like a very hard problem.

I think there is enough information in a POSIX locale to determine
what the rules for constructing such bounds would be ... but there is
no programatic interface to determine the rules a locale uses for
collation.  (I have no idea what non-POSIX systems provide.)

(The localedef program can build a locale.  strcoll() and strxfrm()
can use the collation information.  That's all I see.)

In the absence of a way to do this "right" we need someone to see a
"good enough" hack that happens to work everywhere, or else give up
using indexes for LIKE which I doubt would please anyone.  I suppose
the mismatch comes about because LIKE is about pattern matching and
not collation. :(

Regards,

Giles


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

Предыдущее
От: Don Baccus
Дата:
Сообщение: Re: Proposal: TRUNCATE TABLE table RESTRICT
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: DROP COLUMN status