Re: Good Informix bug found
Posted in 1996
Nils Myklebust wrote: > > Gabriel Beccar-Varela <gabriel@emf.net> wrote: > > ...original about date fields sniped... > > :Any type of conversion will delay the query considerably. For example, if > :you are comparing a smallint field with a string of numeric digits (i.e. > :WHERE Numeric_field = "12345"), the query would take 5 to 10 times longer > :than comparing data of the same type. When you are comparing a date field > :with a date string, Informix must first convert the string to a date value > :before comparing thee two. I do not believe this is a bug. The delay is > :simply due to the fact that Informix is doing a lot of work. > > But Informix should be able to do this conversion once only in these > cases. > The query should take at most some milliseconds longer. > Even if they do convert for every row, why does it take this much > longer if there is no bug? > I haven't tested this, but might one day. > > Nils.Myklebust@ccmail.telemax.no > NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway > My opinions are those of my company We noticed that in 7.x in a similar situation, integer to char conversion, the engine does a sequential scan instead of indexed when it does the conversion. Very odd. Just by changing the variable from integer to char the query screamed.