Reputation: 61
I'm using SQL Server 2008 R2 and I have a table in my database that looks something like this.
Id (Int), Name(NVarChar), DateCreated(DateTime), Message(NVarChar)
Only 3 queries are run against this database table
select top 1 *
from table1
where Name = @input // almost all Names are unique, used 55% of the time
select top 100
from table1
where DateCreated > @input // used 40% of the time
insert... //create new record, used 5% of the time
This table has over 20 million rows.
How can I optimize this database?
Upvotes: 0
Views: 196