Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jpomfret opened this issue Dec 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@jpomfret
Copy link

jpomfret commented Dec 7, 2023

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

@Matteo-T
Copy link
Collaborator

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 Matteo-T added the bug Something isn't working label Jun 30, 2024
@jpomfret
Copy link
Author

jpomfret commented Jul 3, 2024

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: microsoft/sql-server-samples#1260

Let me know if you need further help testing

Thanks!

@jpomfret
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants