Outer join / index loss - strange behaviour
Posted in 2000
Hi,
Had a weird one today. I had a query with a lot of outer joins.
It should (according to data) have returned one row but it didn't. I
returned 4 rows, the real one with most of the values not null, and
others with nulls in various fields. I couldn't find any explaination
and the usual method of dropping bits off the query until it started
to behave didn't find the smoking gun.
Had a look at sqexplain.out and one of the indexes was not being used.
I checked the index and it wasn't there so I re-created it and ran
update statistics high.
This solved the problem. Weird. I didn't think that the index effected
the results of the query, only its access path. Could a corrupted
index done this?
TIA
Steve
---------------------------------------------------------
Steve Roach: Remove NOSPAM from address to reply:
steve_roach@NOSPAMattglobal.net
steve_roach@NOSPAMhotmail.com