Query execution plan issue?
HI DBA Gurus,
I have a query which when running in production is faster, but slow in UAT.
I checked the execution plan for production, there the plan is resulting in row count of 28807 only but cost of 1339K, whereas in UAT it's going for a plan that is accessing 283K rows with a cost of 1111k.
As seen, the production execution plan uses an index created for 3 columns in a large table, whereas the plan in UAT uses another index created on the same table but on only one of the rows.
I am guessing the rows accessed in higher in UAT because of this. Have pasted the explain plan output for UAT below. Can anyone help? How can I make sure the query uses the other index?: