• Matt Miller (#4) (5/30/2008)


    CREATE NONCLUSTERED INDEX IX_OrderDetailDateProdSold ON dbo.OrderDetail

    ( OrderDate ASC, ProductID ASC) INCLUDE (QtySold);

    Matt,

    Any specific reasons you wouldn't go for:

    CREATE NONCLUSTERED INDEX IX_OrderDetailDateProdSold ON dbo.OrderDetail

    ( ProductID ASC, OrderDate ASC) INCLUDE (QtySold);

    which (quite probably.Here I assume more products then dates in your solution) would have a much higher cardinality and would be far more effictive?

    Regards,

    Hans