SQLServerPSModule icon indicating copy to clipboard operation
SQLServerPSModule copied to clipboard

Invoke-SqlAssessment - IndexFragmentation rule doesn't take partitions into consideration

Open jpomfret opened this issue 1 year ago • 3 comments

If I run the following to check my local pubs database for fragmentation (config.json lowers the threshold to 0) I get three rows per index as it is a partitioned table.

$inst = Connect-DbaInstance -SqlInstance mssql1 -SqlCredential $sqlCred
$inst.databases['pubs'] | Invoke-SqlAssessment -Check IndexFragmentation -Verbose -Configuration .\config.json

image

If you add sp.partition_number into the query that runs this check you'll be able to see which partitions are fragmented and then this could be appended to the message returned image

jpomfret avatar Dec 07 '23 16:12 jpomfret

Hey @chlafreniere - is this something your Team own these days? If so, could you take a look into it? If not, please assign back to me... and/or we can chat when you have a minute.

Matteo-T avatar Jun 30 '24 18:06 Matteo-T

Hey @Matteo-T \ @chlafreniere,

Thanks for picking this up - it's causing me a bit of a blocker so would be ace to get some movement.

I worked with one of my colleagues to come up with a potential solution - it's documented here as I wasn't sure where the right place was: https://github.com/microsoft/sql-server-samples/issues/1260

Let me know if you need further help testing

Thanks!

jpomfret avatar Jul 03 '24 07:07 jpomfret

Hi @Matteo-T \ @chlafreniere - just wanted to see if there were any updates here? Thanks

jpomfret avatar Jul 26 '24 08:07 jpomfret