From: Stuart Ainsworth on
On Jul 1, 10:38 am, "Roy Harvey (SQL Server MVP)"
<roy_har...(a)snet.net> wrote:
> Are there any other indexes on the ORDERS table?  At a minimum you
> would need an index on OrderID for the subqueries in the SELECT list
> to work efficiently.  As shown, with no such index, each of the
> subqueries executed has to perform a complete table scan.  Note that
> an index on (OrderID, itemclass, OrderAction) might perform a bit
> better than one just on OrderID.
>
> Roy Harvey
> Beacon Falls, CT
>

In addition, you may want to check that your clustered index is not
fragmented; given that your clustered index starts with CustID and
ends with OrderDate, the insertion of new orders could be causing page
splits (unless you have an ongoing maintenance plan to clean it up).

Stu
 | 
Pages: 1
Prev: 2005 vesion changes
Next: Insert Records