Sunday, September 15, 2013

Best way to store a value to query latest without de-nomalizing?

Best way to store a value to query latest without de-nomalizing?

This is the structure of my Table which stores meter readings for
machines. I need to save all readings so I can retrieve readings for any
date and validate any new readings.

I have an index on AssetID, ForDate Descending so the latest readings are
at the top.
It's taking too long to find the latest meter reading for a machine with
this table. I don't want to de-normalize the meter reading against the
Machine as it would cause concurrency issues when two or more people try
to enter readings at once.
Any suggestions to make this faster?

No comments:

Post a Comment