• quote:


    This interval field -- is it able to be of a unit smaller than the smallest time interval stored in the DB? If so, you might be heading for trouble, and should think about adjusting your smallest time interval storage. I, like Andy it seems, am a bit confused as to the overall objective of your queries, and also, the application. What are the users doing with this data? How do your queries need to return data, and what data is being returned, and how often? I don't really see the need for an "intermediate application" unless you are running some sort of queueing or polling server in between the database and the client...Please specify some more...


    The interval field can be at most 1 millisecond, which SQLServer supports. I will try to explain the issue I am trying to solve a bit more -

    I have values stored on the basis of time in a table. Let's say I have perfomance monitoring application, which monitors the CPU usage of an app, and logs it into this table. It logs the value and the time whenever it detects a suitable change in the CPU usage of the app. So I would be having data of this sort in the table -

    TIME CPU_USAGE

    --------------------------------------

    11:00:01.000 10.1

    11:00:01.900 15.4

    11:00:02.550 0.0

    11:05:04.789 2.3

    Now, what I want to acheive is that when the user queries this table for data and specifies an interval value, (say 500ms) then I want the result to be like this -

    TIME CPU_USAGE

    -------------------------

    11:00:01.000 10.1

    11:00:01.500 10.1

    11:00:02.000 15.4

    11:00:02.500 15.4

    11:00:03.000 0.0

    11:00:03.500 0.0

    11:00:04.000 0.0

    11:00:04.500 0.0

    11:00:05.000 2.3

    As you can see I have interpolated the data as per the interval value specified. I want to embed this logic in such a way that when the user requests data from the table like, SELECT TIME, CPU_USAGE FROM MYTABLE WHERE INTERVAL = 500, I would like that logic to get executed and return the result set as shown above.

    Hope this clears the confusion!

    Thanks,

    Krishnan