Ravi B, September 28, 2016 - 2:06 pm UTC
Thanks for your reply.
Is dynamic sampling and extended stats mutually exclusive or complimentary? Could you please tell which is appropriate at which situations?
Thanks!
September 29, 2016 - 1:18 pm UTC
Not mutually exclusive but typically different use cases.
If I am running hundreds/thousands of queries of the kind:
where col1 = ... and col2 = ...
Then the last thing I want to do is continuously dynamic sample the data, because dynamic sampling is not free - it uses resources to do it. I'll look at extended stats to get the best stats I can on that column combination.
Conversely, I cant have stats on *every* possible column combination. But for a data warehouse, where my queries might take minutes to run, I might definitely consider doing a lot of sampling because its still a tiny proporition of the overall run time, and that sampling might handle lots of rare or odd combinations of columns, joins etc.
Hope this helps.
Thanks!
Ravi B, September 29, 2016 - 4:25 pm UTC
Thanks, that helps!