Re: select is not using index? - Mailing list pgsql-performance

From Mark Harrison
Subject Re: select is not using index?
Date
Msg-id 40227DEC.5010007@pixar.com
Whole thread Raw
In response to select is not using index?  (Mark Harrison <mh@pixar.com>)
List 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


pgsql-performance by date:

Previous
From: "Damien Dougan"
Date:
Subject: Re: Index Performance Help
Next
From: Orion Henry
Date:
Subject: Re: 7.3 vs 7.4 performance