Re: [HACKERS] indexes and floats

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, vev(at)michvhf(dot)com, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] indexes and floats
Date: 1998-08-04 04:43:26
Message-ID: 199808040443.AAA12363@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > Ah-hah, all of a sudden this looks *real* familiar. I bet it's
> > because pgsql is not noticing that "500.0" can be interpreted as a
> > float4. Let's try it.
>
> Oh, you have nailed it! This is interesting because (probably) a query
> like
>
> select f4 from t4 where f4 = 500.0;
>
> is being automatically "upgraded" in the parser backend to
>
> select f4 from t4 where float8(f4) = 500.0;
>
> So, since there is no functional index float8(f4) on the table we cannot
> use an existing index on f4 to advantage.
>
> This may be a result of my recent enhancements to the automatic type
> coersion code. But I'm a little suprised that v6.3.x doesn't just
> complain about a type mismatch but instead actually works. It may be
> that the old code which converted constants using intermediate strings
> worked (sort of) for this case. In general, the pre-enhancement code
> _only_ tried to convert constants, and complained about type mismatches
> when non-constants were involved.

Yes, it did numeric constants, I think.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-08-04 04:48:24 Re: [HACKERS] indexes and floats
Previous Message Vadim Mikheev 1998-08-04 04:41:35 Re: [HACKERS] indexes and floats