Re: ORDER BY case insensitive?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: ORDER BY case insensitive?
Дата
Msg-id Pine.BSF.4.21.0110041443380.58252-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: ORDER BY case insensitive?  (Jason Earl <jdearl@yahoo.com>)
Список pgsql-sql
On Thu, 4 Oct 2001, Jason Earl wrote:

> My guess is that compared to the task of sorting
> millions of names the fact that you have to lowercase
> them first is not going to be a particular burden.  No
> matter what you do you are going to get a table scan
> (unless you qualify your select with a where clause).
> 
> You can, however, create an index like:
> 
> create index MyTable_lower_idx on MyTable
> (lower(name));
> 
> It won't help with your particular query, but it
> certainly would help for queries like:

Current sources do (and I think older sources may) consider
such an index to replace the sort step.  On a test table with
100000 strings, explain shows an index scan for the lower(<col>)
ordering and a seq scan/sort for <col> ordering. At this point
there's actually a performance gain for the lower() index scan.




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

Предыдущее
От: Jason Earl
Дата:
Сообщение: Re: ORDER BY case insensitive?
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: Need Help!!