pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Eugeny Balakhonov <c0ff75@mail.ru>
Cc: pgsql-performance@postgresql.org
Subject: Re: PostgreSQL performance in simple queries
Date: Wed, 19 May 2004 17:51:08 -0400
Message-ID: <40ABD6CC.3070206@samurai.com> (raw)
In-Reply-To: <1117434122.20040520000757@mail.ru>
References: <1117434122.20040520000757@mail.ru>

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



view thread (7+ messages)  latest in thread

Message-ID: <40ABD6CC.3070206@samurai.com>
Permalink:  ../40ABD6CC.3070206@samurai.com/
Also on:    postgresql.org/message-id/40ABD6CC.3070206@samurai.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: neilc@samurai.com, c0ff75@mail.ru
  Subject: Re: PostgreSQL performance in simple queries
  In-Reply-To: <40ABD6CC.3070206@samurai.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox