Re: PostgreSQL performance in simple queries

Neil Conway <neilc@samurai.com>

From: Neil Conway <neilc@samurai.com>
To: Eugeny Balakhonov <c0ff75@mail.ru>
Cc: pgsql-performance@postgresql.org
Date: 2004-05-19T21:51:08Z
Lists: pgsql-hackers, pgsql-performance
Eugeny Balakhonov wrote:
> I tries to run simple query:
> 
> select * from files_t where parent = 3333

Use this instead:

select * from files_t where parent = '3333';

("parent = 3333::int8" would work as well.)

PostgreSQL (< 7.5) won't consider using an indexscan when the predicate 
involves an integer literal and the column datatype is int2 or int8.

-Neil