I'd like to capture all queries executed against my database to be able to make the right index need decisions.
I'm familar with Profiler and SQL Trace and also saw the possiblity to use extended events, but the optimal solution would be something that aggregates me the queries and writes out the repeatedly requeries only once, so I get an aggregated view.
Would it be enough to analyse the sql_handles from the sys.dm_exec_query_stats_cache or is there maybe a DMV for that?
I need to capture the workload for a long period of time, because same actions happen f.e. only monthly...
Could anybody help me how I could realize it to get an overview over all queries for a long time, which aggregates the same queries and let's me order after tables or other measures?