Re: Good Informix bug found
Posted in 1996
Topics: Performance & Tuning
} Date: Mon, 05 Aug 1996 09:25:01 -0700 } From: Jim Gordon <jgordon@US.DHL.COM> } Organization: DHL Airways Inc. } To: Stuart Litel <slitel@netcom.com> } Cc: informix-list@rmy.emory.edu } Subject: Re: Good Informix bug found } Reply-to: Jim Gordon <jgordon@US.DHL.COM> } Stuart Litel wrote: } > } > This is one of my favorite Informix bugs I have found in a while.... } > } .... } > } > 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. } > } } Stuart, } } I would be very interested in the result for the following. } } select count(*) from table where table.date_field = date("8/4/96") } } This should run as fast as using today because it compares a date with a } date. Your original query compares a date with a string so there is an } impied type conversion. I suspect that this type conversion occurs for } every single match check rather than just once for the entire query. } } Not exactly a bug, certainly an area for some serious performance } enhancing code re-work. } } Cheers - Jim } } -- } ------------------------------------------------------------------------ } Jim Gordon DHL Airways Inc. } jgordon@us.dhl.com } ------------------------------------------------------------------------ } My opinions are my own. They may vary with time but they remain mine! } } that problem success when compare : year(today) = "1996" instead of year(today) = 1996 the second form is very very faster than the first one ================================================== - Johnny Antonio Valdez Arevalo - jvaldez@sunat.gob.pe - SuperIntendencia Nacional de Administracion - Tributaria. - Lima - Peru ==================================================