Re: Indexes not used in 7.1RC4: Bug? - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Indexes not used in 7.1RC4: Bug?
Date
Msg-id 3AD36240.96B75656@alumni.caltech.edu
Whole thread Raw
In response to Re: Indexes not used in 7.1RC4: Bug?  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Responses Re: Indexes not used in 7.1RC4: Bug?  (Thomas Swan <tswan-lst@ics.olemiss.edu>)
List pgsql-hackers
Hmm. The problem is as you describe, but the requirements for a solution
are more severe than you (or I) would hope. 

We would like to have an extensible mechanism for type promotion and
demotion, but it is not (yet) clear how to implement it. In this case,
we must demote a constant assigned as "int4" by the parser into an
"int2" to be directly comparable to the indexed column. We could
probably do this with some hack code as a brute-force exercise, but no
one has yet bothered (patches welcome ;) But in general, we must handle
the case that the specified constraint is *not* directly convertible to
the indexed type (e.g. is out of range) even though this would seem to
reduce to a choice between a trivial noop or a sequential scan of the
entire table. If we can do this without cluttering up the code too much,
we should go ahead and do it, but it has apparently been a low priority.
                        - Thomas


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Going from 7.0.3 -> 7.1 ...
Next
From: Andrew McMillan
Date:
Subject: Re: "--tuning" compile and runtime option (?)