Re: again, LIKE operator

Поиск
Список
Период
Сортировка
От Andy Samuel
Тема Re: again, LIKE operator
Дата
Msg-id 000d01c19b55$82c37ea0$0200a8c0@edpgm
обсуждение исходный текст
Ответ на again, LIKE operator  ("Andy Samuel" <andysamuel@geocities.com>)
Ответы Re: again, LIKE operator  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-general
Just forget my previous email.
 
PostgreSQL does not use index on LIKE 'a%' but it will use the index if LIKE 'ab%' or something longer.
So the optimizer thinks it is not good enough if it's only 1 character.
Well done !
 
Thank you
Andy
----- Original Message -----
Sent: Saturday, January 12, 2002 11:35 AM
Subject: [GENERAL] again, LIKE operator

Dear All
 
I've search the archive and manuals and it says I should use C locale in order to enable LIKE to use index.
Postgresql was installed after I set the locale to C.  So I'm sure the initdb will use C.
From EXPLAIN I know that :
 
SELECT * FROM GuestProfile WHERE FirstName LIKE 'a'      will use index on FirstName
 
but
 
SELECT * FROM GuestProfile WHERE FirstName LIKE 'a%'   will not use Index on FirstName
 
I have 9,999,999 records and it was VACUUM ANALYZE-d.
 
How do I enforce the optimizer to use the index ?
 
Thank you in advance
Andy

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Does pg_dumpall do BLOBs too?
Следующее
От: Frank Bax
Дата:
Сообщение: Re: again, LIKE operator