Reputation: 51
From below query I have given all the components for index vdmod_idx1. But when I checked XREF, I can see the compiler choose vdlist since it is primary unique. May I know why it is behaving like this. I would like to know what's happening here
And moreover, if I use index vdmod_idx1 in my query to then only it picks vdmod_idx1
for last vdhist no-lock
where vdhist.vddomain = dom
and vdclassification = 1
and vdhist.vdlist = prlt
and vdhist.vdprod_ln = prodLn
and vdhist.vdcurr = curr
and vdhist.vdpart = part
and vdhist.vdum = tt_um
and vdhist.vdstart = date(tt_start)
and vdmod_date > 01/01/2021
and vdmod_time > 45556:
end.
Index used
pu vdlist 10 + vddomain
+ vdclassification
+ vdlist
+ vdprod_ln
+ vdcurr
+ vdpart
+ vdum
+ vdstart
+ vdcrt_date
+ vdlocal_rsn
vdmod_idx1 10 + vddomain
+ vdclassification
+ vdlist
+ vdprod_ln
+ vdcurr
+ vdpart
+ vdum
+ vdstart
+ vdmod_date
+ vdmod_time
Upvotes: 0
Views: 82