You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a known issue, plans of type ORDER ... INDEX are often bad from the performance POV. And this has been already addressed in v6.0.
Moreover, your example is not very accurate, because indices FK_POZ1__HDR / FK_POZ2__HDR are created before the table is populated and thus have zero selectivity. If I add SET STATISTICS for them to the end of the script, I see the following plan in v6.0 (without +0 hints):
Below script for database:
run this query
PLAN (P ORDER IXD_POZ1__DT INDEX (FK_POZ1__HDR))
time 2044 ms
same for this:
PLAN (P ORDER IXA_POZ2__DT INDEX (FK_POZ2__HDR))
time 2067 ms
now remove index retrival and change it to sort by +0 trick
PLAN SORT (P INDEX (FK_POZ1__HDR))
time 148 ms
so we have 13 times slower!
The text was updated successfully, but these errors were encountered: