Re: Indexes not used in 7.1RC4: Bug?

From: Thomas Swan <tswan-lst(at)ics(dot)olemiss(dot)edu>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Mark Butler <butlerm(at)middle(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Indexes not used in 7.1RC4: Bug?
Date: 2001-04-11 14:06:58
Message-ID: 5.1.0.12.0.20010411085720.00ae2158@tangent.ics.olemiss.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

At 4/10/2001 02:42 PM, Thomas Lockhart wrote:
>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.

What about going the other way around... Promote the int2 to an int4
(lossless). Actually for all int1,int2 datatypes (regardless of whether it
was the constant or the column) you could promote all to a common int4 and
then do comparisons. Promoting all to int8 and then doing a comparison
would be excessively slow.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martín Marqués 2001-04-11 14:07:45 Re: PHP question
Previous Message Justin Clift 2001-04-11 14:00:36 Non-english articles on the techdocs.postgresql.org website

Browse pgsql-hackers by date

  From Date Subject
Next Message andrea gelmini 2001-04-11 14:50:31 cvs postgres doesn't compile with libreadline 4.2
Previous Message Philip Warner 2001-04-11 11:42:11 Re: Re: HOLD THE PRESSES!! ... pg_dump from v7.0.3 can't import to v7.1?