Text indexes...

Поиск
Список
Период
Сортировка
От Vince Vielhaber
Тема Text indexes...
Дата
Msg-id XFMail.980803151051.vev@michvhf.com
обсуждение исходный текст
Список pgsql-hackers
It's me and them indexes again.  This time back to text.

What is the difference (as far as an index is concerned) between:

select city from locations where lower(city) = lower('st. ignace');

and

select city from locations where lower(city) = 'st. ignace';

The index was created like this:

create index locations_city on locations(lower(city) text_ops);


The first gives me the Seq Scan and the second gives me the much needed
Index Scan (there are almost 170K rows in the table).  I can probably
do the lower case conversion in advance in C (since this is called from
a C program) but what am I missing with the difference between these two
statements?   As long as it's receiving lower case, why should the
optomizer care what's on the right side of the equal sign?

Very confused,
Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev@michvhf.com   flame-mail: /dev/null
       # include <std/disclaimers.h>                   TEAM-OS2
   Online Searchable Campground Listings    http://www.camping-usa.com
       "There is no outfit less entitled to lecture me about bloat
               than the federal government"  -- Tony Snow
==========================================================================



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Bug in gram.y?
Следующее
От: Peter T Mount
Дата:
Сообщение: Re: [HACKERS] initdb problems