Open heaivilinn opened 2 years ago
@olahallengren, is there something specific I need to do to get this PR approved and merged into the core source control? Or is it just a matter of time and resources? Appreciate the update.
@heaivilinn , great job on that index optimize code for polybase table stats. A few things missing:
@steverezhener, apologies for the very long wait on a response here. Somehow got unsubscribed and then I got pulled away on other things.
Regarding No.1, wouldn't this be handled by the @CurrentUpdateStatisticsWithClauseArguments variable that is added to @CurrentCommand on line 2347? Code seems to show it, but I'm having to rebuild my test environment as I've switched jobs and the new one doesn't use Polybase at present.
Regarding No.2, potentially, but would you want it to do this? I'd be interested in what the community thinks. Maybe something that is done, but not turned on by default as I know I wouldn't want it done by default without my knowledge.
Per Microsoft, statistics for external tables cannot be ALTERED. If a rebuild is required, they must be dropped and re-created. As such, I've updated the code to correctly identify external tables and drop/add stats on them by default. A parameter was added that if change to anything other than REBUILD, will ignore stats maintenance work on external tables.