Informix SE vs. Online Query
Posted in 1993
Topics: Performance & Tuning, SQL Development & Query Writing
I have this one application that is running on 2 machines. They are both
sun sparc 2 and running Informix 4.1 . The difference is that one machine
is using Informix Standard Engine (SE) and the other one is using Online
Engine. The data schema is identical on both machines and the amount of
data is the same too. I am researching to see why this application is
taking a long time to do a query on the SE and it takes no time at all on
the Online ( I did take into consideration that the Online should be
faster but still the difference is very significant , like 1 minute versus
50 minutes). So I used 'set explain on' and here are the results:
Query:
Select count(*) from table1 where field1 not in
(select field1 from table2)
Note: field1 has a unique index on both table1 and table2
Results:
On the SE, the subquery is done thru a SEQUENTIAL SCAN
On the Online, the subquery is done thru a INDEX PATH
Index keys: field1 (Key-Only)
I have called Informix Technical Support and the engineer first told
me that it was correct the way how the SE optimizer worked (doing
SEQUENTIAL SCAN) and then when I told him about the way how Online
optimized the query, he suggested me to check for index corruption
in the SE ???? Anyway,I complied and found nothing wrong with the index on
both machines .
QUESTIONS:
1) Is the SE optimizer doing the correct thing ,i.e. doing a
SEQUENTIAL SCAN?
2) If SE optimizer is doing the correct thing, then is it correct
to say that the Online Optimizer is in a way 'enhanced' and knows how to
make better use of the indexes?
Any input would be very much appreciated. Thanks!