Re: How to best use clustered index?
From: AndrewV (nospam_at_yahoo.com)
Date: 02/13/04
- Next message: Delbert Glass: "Re: top n problem"
- Previous message: Steve Kass: "Re: UPDATE Using Previous Record Value"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Feb 2004 15:14:35 -0800
Thanks very much for the advices, really appreciate it Tom, Michael. Have a
great day guys.
"AndrewV" <nospam@yahoo.com> wrote in message
news:uB5OGvk8DHA.2316@TK2MSFTNGP09.phx.gbl...
> I have an Order table that is used heavily. About 90% of queries is
looking
> for 1 particular sales order and is joining with other tables via the
> primary key to get relevant data (select * from Order inner join
OtherTable
> on Order.OrderKey = OtherTable.OrderKey where Order.OrderKey = @OrderKey).
> The remaining 10% is looking for the same set of data, but over a date
range
> (select * from Order inner join OtherTable on Order.OrderKey =
> OtherTable.OrderKey where Order.OrderKey = @OrderKey and Order.CreatedDate
> between x and y).
>
> My thought is to clustered index on the primary key since it is used alot
> for joining with other tables. Or is it better to clustered index on the
> CreateDate field because it is sometimes queried for a date range? Is
> clustered index best used on a column that is used heavily for joining, or
> on a column that will be queried for a range of data?
>
> Thanks very much in advance.
>
>
- Next message: Delbert Glass: "Re: top n problem"
- Previous message: Steve Kass: "Re: UPDATE Using Previous Record Value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|