Are you trying to get just one row or the latest entry for many/all AssetID? If you are trying to query for many the latest entry for many different assets then the index will not help you much.
I would suggest you to
- Add a now column
IsLatestReading(bit)
Add
trigger for INSERT, UPDATE, DELETE
to keep columnIsLatestReading
just be careful with the recursive trigger it will causethe trigger something like:
update MyTable set IsLatestReading = 0 inner join DELETE on DELETE.AssetID = MyTable and IsLatestReading = 1 update table MyTable set IsLatestReady = 1 inner join INSERTED on INSERTED.MeterReadingID = MyTable.MeterReadingID
create index
onIsLatestReading DESC, AssetID, ForDate
Note: If you use bulk insert to load the readings, you'll won't need the trigger, just an update to the column would do...