I just inherited another DB (SQL 7). I've found a table with more indexes than columns with index sizes larger than the PK.
There are no unique items in the table. It looks like a data dumping ground. This data is updated, deleted and inserted, triggered off of and read consantly.
I'm really not not that confident with indexes etc.. though I am researching them and hope to be real soon. From what I've read so far I might as well get rid of all but the PK and even its retention is questionable.
Any advice would be appreciated.
Thanks
Dan
The most frequent Sql statment that hits (very frequently)the tabel is :
There are no unique items in the table. It looks like a data dumping ground. This data is updated, deleted and inserted, triggered off of and read consantly.
I'm really not not that confident with indexes etc.. though I am researching them and hope to be real soon. From what I've read so far I might as well get rid of all but the PK and even its retention is questionable.
Any advice would be appreciated.
Thanks
Dan
Code:
Table student_data col's:
CurItemID INT
UserID INT
Date smalldatetime
Quantity decimal (9,2)
10,330,300 rows
PK_student_data 299MB Non Clustered
IX_USERID_QTY 385MB Non Clustered
IX_Userid_Qty 332MB Non Clustered
IX_StudentData_Curitem_ID 282MB Non Clustered
IX_Student_Data_Userid 297MB Non Clustered
IX_Student_Data_Date 334MB Non Clustered
The most frequent Sql statment that hits (very frequently)the tabel is :
Code:
SELECT S.UserID, Quantity, Date, S.CurItemID, SeqNum
FROM StudentData S
INNER JOIN Curriculum C ON S.CurItemID = C.CurItemID
Where userid = 1234
and s.date between Thisdate and thatdate
ORDER BY c.SeqNum, s.Date'