Is this a Bug? - Take 2
Posted in 1996
I appreciate all the responses to my original question. They have all
been helpful. However, given the diversity of the responses, it seems
that I need to include some additional information.
I must first point our that I made an error when I brought the
OPTCOMPIND variable into play. I was dealing with two similar
problems on that day and the OPTCOMPIND modification solved the other
one.
My original problem - restated - is this:
Below is the set explain output from two very similar queries. Please
look carefully at the SQL. These queries do return different results.
Should they? We have differing opinions within our database team.
We are currently running Informix OnLine 7.11.uc1 on a SparCenter
2000E with Solaris 2.4. The database is approximately 70 gig with
informix mirroring. We extensively fragment our tables and indexes,
and many indexes are detached.
The updated information is as follows:
There is a unique index on item_number in the item_master table.
There is a unique constraint on item_number in the item_xref table.
The particular item number, "02124" is unique in both tables.
The data types are identical in both tables.
All the indexes involved are NOT detached.
QUERY:
------
select *
from item_master im, outer item_xref ix
where ix.item_number = "02124"
and im.item_number = ix.item_number
Estimated Cost: 58582
Estimated # of Rows Returned: 1
Maximum Threads: 1
1) informix.im: SEQUENTIAL SCAN
2) informix.ix: INDEX PATH
Filters: informix.ix.item_number = '02124'
(1) Index Keys: item_number sales_category
Lower Index Filter: informix.ix.item_number =
informix.im.item_number
QUERY:
------
select *
from item_master im, outer item_xref ix
where im.item_number = "02124"
and im.item_number = ix.item_number
Estimated Cost: 69
Estimated # of Rows Returned: 1
Maximum Threads: 1
1) informix.im: INDEX PATH
(1) Index Keys: item_number
Lower Index Filter: informix.im.item_number = '02124'
2) informix.ix: INDEX PATH
(1) Index Keys: item_number sales_category
Lower Index Filter: informix.ix.item_number =
informix.im.item_number