Re: select is not using index?

From: Mark Harrison <mh(at)pixar(dot)com>
To: Corey Edwards <coreyed(at)linxtechnologies(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: select is not using index?
Date: 2004-02-05 17:31:24
Message-ID: 40227DEC.5010007@pixar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Corey Edwards wrote:

> Your column is a bigint but 123 defaults to type int. Indexes aren't
> used when there's a type mismatch. Use an explicit cast or quote it:
>
> select * from bigtable where id = 123::bigint;
>
> Or
>
> select * from bigtable where id = '123';

Thanks Corey, both of these do exactly what I need...

Cheers,
Mark

--
Mark Harrison
Pixar Animation Studios

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Orion Henry 2004-02-05 18:04:44 Re: 7.3 vs 7.4 performance
Previous Message Damien Dougan 2004-02-05 16:40:10 Re: Index Performance Help