RE: no index used
Posted in 2000
I seem to recall having better luck getting the results I wanted with
unions instead of or statements, you might try that.
Will
>===== Original Message From steinhoefel@dcs-systeme.de =====
>Thanks again for your answers,
>
>I had already tried to change OPTCOMPIND from 2 to 0 - with no effect - and
>used "update statistics" before I posted my question.
>Today I tried a "update statistics high", and now I get better answers from
>the server, but it is by far not what I expect from it.
>It now uses simple indexes in the matter I'd expect - most of the time - but
>it still refuses using combined indices. There is a combined index on
>(kmi,mti) as you can see from my post of the table definition. On that table
>I do selects with a lot of conditions, for instance 10 kmi conditions each
>one with 40 mti conditons in the following matter:
>select pkey from table1 where>kmi = 5 and (mti between 10 and 39 or mti between 60 and 99 or mti or mti
>between...) or
>kmi = 5262 and (mti between 0 and 4 or mti between 50 and 54 or mti
>between...).
>
>For such selects the system does a table scan. This is not necessary, the
>answer is just a small part of the whole table. That these my theory is
>rigth I see at the results of selects just with kmi (let out all mti
>conditions): it's very fast now, much faster than a table scan.
>Even if I try just two kmi each one with one mti condition the Index is not
>used.
>
>Today I encountered another problem:
>kmi and mti are spatial index columns for lkr and lkh(x and y). So against
>all theory I tried to use lkr and lkh directly, with no spatial index. So I
>did a index on lkr, and selects with very small answers where accelerated
>fine, but if had big answers (a lot of rows) it was a catastrophe. Selecting
>the whole table with the index was as 15 times !!! as slow as a table scan.
>Now my question: Is it generally not adviceable to use indices on float
>columns in informix?
>If I cannot resolve my mti problem I plan to put kmi and mti together into a
>double (I need at least 32 bit for kmi and 7 bit for mti). So would this be
>a useful try?
------------------------------------------------------------
This e-mail has been sent to you courtesy of OperaMail, as a free service from
Opera Software, makers of the award-winning Web Browser, Opera. Visit us at
http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail
account is waiting at: http://www.operamail.com/
------------------------------------------------------------