Re: why isn't index used? - Mailing list pgsql-general

From Thomas O'Dowd
Subject Re: why isn't index used?
Date
Msg-id 1034038475.20171.134.camel@beast.uwillsee.com
Whole thread Raw
In response to Re: why isn't index used?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn,

> You picked it. The parser reads your number as an int4 and the planner
> assumes that you can't use int4's on an int8 index. It sounds brain-dead. It
> is brain-dead, except that it's also not easy to fix. Putting quotes around
> the number means the planner will treat it as unknown and it works.

Thanks for the reply. It would be great to get this added to the DOCS so
that the next person doesn't spend a day trying to figure it out too.
Also, which is faster: using '3' or 3::int8? I presume shorter is
quicker to parse, but is there an advantage over treating it as an
unknown and an explicit cast?

Tom.
--
Thomas O'Dowd. - Nooping - http://nooper.com
tom@nooper.com - Testing - http://nooper.co.jp/labs


pgsql-general by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Re: PLTCL return_null crash...
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: PLTCL return_null crash...