Re: Good Informix bug found
Posted in 1996
* 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.
What happens when you change the first one to:
select count(*) from table where table.date_field = DATE("8/4/96")
Thanks,
-----------------------------------------------------------------------------
Robert Minter Data Systems Support
Senior Software Engineer A Client Technologies Company
E-Mail: rob@dssmktg.com Tel: 714.771.0454
Fax: 714.771.3028
#include <std_disclaimer.h> http://www.dssny.com