Posted by Alexander Kuznetsov on 10/22/14 11:29
>The theory I have heard is that columns with the most distinct values
>should come first
There are quite a few exceptions. For instanse, if you have a table
ORDERS with PK on (CUSTOMERS_PK, some_other_column) and a FK constraint
referencing table CUSTOMERS, you might want to have CUSTOMERS_PK column
first even if it is less selective than the other column.
There aren't that many hard and fast rules in our trade
[Back to original message]
|