Re: PostgreSQL performance in simple queries

From: Neil Conway <neilc(at)samurai(dot)com>
To: Eugeny Balakhonov <c0ff75(at)mail(dot)ru>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: PostgreSQL performance in simple queries
Date: 2004-05-19 21:51:08
Message-ID: 40ABD6CC.3070206@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2004-05-19 22:51:29 Re: Table Spaces
Previous Message Bruce Momjian 2004-05-19 21:21:12 Re: [HACKERS] pg_dump end comment

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2004-05-20 01:20:20 Re: Wierd context-switching issue on Xeon
Previous Message Gary Doades 2004-05-19 20:23:47 Re: PostgreSQL performance in simple queries