• I might be missing something (probably am, since others have already suggested things to check, indicating they've understood what the problem is), but what exactly is the problem? I haven't quite figured out what the problem is supposed to be 🙂

    Also, it's not just a server restart that could distort these sorts of results. If a particular plan gets removed from the cache (for any reason, aged out, recompiled because of stats changes, etc.), then it'll start with fresh numbers when it gets added back in.

    Independently of whatever this problem is supposed to be, when you're capturing the delta, you should also check to make sure that the cached time in procedure_stats for the post snapshot is the same as the cached time for the pre snapshot.

    Otherwise the comparison doesn't really mean anything.

    Cheers!