On Mon, Feb 03, 2003 at 18:42:31 +0100,
Mikael Carneholm <carniz@spray.se> wrote:
> 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
hasa default btree index as created by the primary key constraint. However, when searching for the same row on one of
it'scolumns (type: text) which has a functional index on lower(column name), the same row was retrieved in 19ms! That's
~335times faster!
This is probably a type coersion issue. You can probably get the first search
to run much faster by including an explicit cast to bigint.