I use Extended Events almost exclusively for capturing query metrics. They are the most consistent and lowest-cost mechanism for getting the time and resources used by a query. They can be filtered, combined with other events... they're just marvelous... until you capture an execution plan.
Execution Plans in Extended EventsDon't get me wrong. Capturing execution plans with Extended Events is the way to go if you're attempting to automate the process of capturing plans on specific queries on an active system. It's Step 2 that bugs me. So, we capture the plan. Here's an example script. Captures all the various plans and the batch and puts 'em together using causality tracking:
No comments:
Post a Comment