Engine using index, not rowid
Posted in 1994
On Online 5.00 and 5.01, the following query does not work quite as
expected:
SELECT *
FROM stoinvce
WHERE ROWID = 1234
AND stage = 'PST'
There is an index on stage and the optimizer is choosing to use the
index instead of the rowid to get the row. This seems to be
consistent with all the indexes on this table, not just this one. If
I leave the index field out of the where clause, everything works
fine.
The table is freshly loaded and the statistics have been run.
Now I know this is a stupid looking query, but I do have to maintain
this code.
We have a work-around (the same one you're thinking of), so please
don't bother telling me other ways to do this. I just want to know
why it is doing what it is doing.
This query does work with Online 4.*.
--
------------------------------------------------------------
robert m. read
tiggyr@netcom.com
For PGP Public Key, finger tiggyr@netcom.com