Re: PostGres is not using indices in select, I would like it to because it is too slow !

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Dominique Dumortier <dominique(dot)dumortier(at)entpe(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostGres is not using indices in select, I would like it to because it is too slow !
Date: 2001-09-27 23:33:03
Message-ID: 20010928093303.C32426@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 24, 2001 at 09:39:19PM +0200, Dominique Dumortier wrote:
> Dear all,
>
> "cix" smallint,
> "ciy" smallint,

> The index is created like that:
>
> CREATE INDEX ci_index on city (cix,ciy)
>
> If I do select ciname from city where cix=400 and ciy=500;

Try putting quotes around the numbers. There are similar issues with bigint
where it can't see that smallint promotes to int4 without loss so it doesn't
realise that it can use an index.. By putting quotes around it, the database
will see them as smallints and (hopefully) us the index.

HTH,

--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-09-27 23:46:41 Re: How to make a REALLY FAST db server?
Previous Message Martijn van Oosterhout 2001-09-27 23:23:14 Re: How to make a REALLY FAST db server?