Subject Trying to fix slow query
Author rjschappe
I have read and re-read past posts on highly selective indices... but
I do not understand what to do with Foreign Key constraints.

From what I understand, when I set up a Foreign Key Constraint, an
index is also created automatically.

So for tables CustOrder, OrderStatus my constraint is set up
from CustOrder.OrderStatus to OrderStatus.ID

but the problem is that almost all CustOrders end up with a status
of "Paid" and gstat reports are not good for FK_CustOrder_OrderStatus

I understand that by creating a new index which includes the PK at
the end (CustOrder.OrderStatus, CustOrder.ID) will help

... but I do not understand what should I do with my original Foreign
Key constraint???

I do not want to delete it... as it is still a FK constraint!

What am I missing here... or am I done, did I just need to add my
highly selective index and that was all...??? and why isn't my query
plan now using my new "highly selective" index?

Thanks,
--Raymond