Re: Good Informix bug found
Posted in 1996
Topics: General Discussion
What's probably happening is datatype conversion. I would argue
that this is not a bug but a fact of life. You are specifying
the date as a string (character) literal. It has to convert it
to internal date format to use the index and to qualify the row.
>==========Stuart Litel, 8/4/96==========
>
>This is one of my favorite Informix bugs I have found in a while....
>
>I have a LARGE database table with about 10+ million rows. ne
>of the fields in the table is a date field and will always have a value.
>
>If this field is indexed (non-unique) or part of a unique index
>
>you run the following two queries
>
>select count(*) from table where table.date_field = "8/4/96">
>or
>
>select count(*) from table where table.date_field = today>
>the SECOND query using TODAY (or today -1 to get to the date needed)...
>is almost THREE TIMES FASTER.
>
>Version: Informix 7.12
>Platform: H.P.
>
>Just an FYI for all.
>
>Stuart
>
>slitel@netcom.com
>
John Susag - john.susag@minneapolismn.ncr.com
NCR Enterprise Consulting
"We are the music makers and we are the makers of dreams"
Willy Wonka