I'm trying to detect if I have some queries that are recompiling for requests from different users opposed to using cache. Here's how I plan on doing that:
SET STATISTICS TIME ON
I realize that this will provide parse/compile and execution time.
The problem is that when User-A executes a particular query, it's slow at first and then fast after subsequent requests. When User-B executes that very same query, it's also slow at first and then faster after subsequent requests.
Will the foregoing be able to tell me whether or not the query is recompiled for User-B after it has compiled for User-A?
Ideally, I'm hoping that it'll compile for User-A and then just reference the existing plan/cache for User-B.
Will existing indexes impact this analysis? Should I drop them?