I am using SQL Server 2005. I have a simple logging table that my web application uses to track user activity and visited URLs. Table design is very simple
Identifier (identifier)
LogDate (datetime),
Activity (nvarchar (200)),
Url (nvarchar (1000))
We mainly put in this table. From time to time, we perform some queries against this table if we want to investigate specific user actions over a period. The table currently contains an identity column as a primary key. This is also a clustered index.
I am wondering if it is better for me to change my clustered index into a LogDate column. The LogDate column stores the date / time of the activity and may have duplicates, but since we always insert into the table, new records should always be at the end of the table, so there is no reason for SQL Server to reorganize or break pages that will affect Insert performance. Having a LogDate column as a clustered index should also help in finding performance.
Please let me know if my reasoning is correct. Thanks!
source share