335 times faster (!)

Поиск
Список
Период
Сортировка
От Mikael Carneholm
Тема 335 times faster (!)
Дата
Msg-id 1044294151024806@lycos-europe.com
обсуждение исходный текст
Ответы Re: 335 times faster (!)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: 335 times faster (!)  (Bruno Wolff III <bruno@wolff.to>)
Re: 335 times faster (!)  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Список pgsql-general
I discovered a strange thing when doing a simple search on a (comparably) large table with ~900K rows today:

When searching for a specific row on the primary key (type: bigint), the search took about 6,5 seconds. The column has
adefault btree index as created by the primary key constraint. However, when searching for the same row on one of it's
columns(type: text) which has a functional index on lower(column name), the same row was retrieved in 19ms! That's ~335
timesfaster! 

My idea is thus that one could create tables with a text type column holding the value of the identifier without using
the'primary key' clause, and then afterwards add a functional index on lower(column name). If performance is the main
issue,this must be an interesting solution. The downside is of course that the text data type may result in invalid
integervalues being inserted as keys. 

Anyone tried this before?

- Mikael

_____________________________________________________________
Här börjar internet!
Skaffa gratis e-mail och gratis internet på http://www.spray.se

Träffa folk från hela Sverige på ett och samma ställe - http://chat.spray.se/



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

Предыдущее
От: "Vilson farias"
Дата:
Сообщение: Drop constraint in PostgreSQL 7.1.2
Следующее
От: Arjen van der Meijden
Дата:
Сообщение: Re: Printer setup