rdevarajan
Programmer
SELECT ORRFNBR, ORMENBR, ORSHNBR, ORMORDER
FROM
ORDERS, ordext, SLOTRESERVATION, SLOTSERVICE
WHERE
srornbr = orrfnbr AND
orrfnbr = oeornbr AND
srstat IS NULL AND
srservice = ssrfnbr AND
srbrnbr = ? and
oereviewed = 0 and
orshnbr = srshnbr
ORDER BY SRDATE, SRSTARTTIME, SRENDTIME, SERVICE_SORT, SRSERVICE
In the above query, the primary index for ORDERS table is 'orrfnbr' . But this query goes on a table spacescan . There is an index on 'srornbr ' which is being used properly.
please help as to why the index is not being used.
FROM
ORDERS, ordext, SLOTRESERVATION, SLOTSERVICE
WHERE
srornbr = orrfnbr AND
orrfnbr = oeornbr AND
srstat IS NULL AND
srservice = ssrfnbr AND
srbrnbr = ? and
oereviewed = 0 and
orshnbr = srshnbr
ORDER BY SRDATE, SRSTARTTIME, SRENDTIME, SERVICE_SORT, SRSERVICE
In the above query, the primary index for ORDERS table is 'orrfnbr' . But this query goes on a table spacescan . There is an index on 'srornbr ' which is being used properly.
please help as to why the index is not being used.