SQL-Server-First-Responder-Kit icon indicating copy to clipboard operation
SQL-Server-First-Responder-Kit copied to clipboard

sp_BlitzIndex table view doesn't tell you about compression

Open LitKnd opened this issue 12 years ago • 13 comments

Liar! Liar! Pants on fire!

LitKnd avatar Jul 02 '14 21:07 LitKnd

It would be really nice if the output CREATE INDEX statement and/or a column in the grid included the data_compression_desc.

Compression information is complicated for partitioned tables (especially if different partitions are compressed differently)--but I think it would be OK to represent that complicated scenario with something like 'MIXED' or '?' (similar to what is done with ONLINE).

amtwo avatar Jul 06 '16 16:07 amtwo

sp_BlitzIndex @Mode = 2 does have a column for Data Compression, and says page or row. If you're only doing manual analysis, does that work?

If not, can you describe what you're looking to solve when you run it? That'll help me figure out how to implement it.

BrentOzar avatar Jul 06 '16 19:07 BrentOzar

My favorite magic incantation is to do something like this while troubleshooting/performance tuning/whatever: EXEC dbo.sp_BlitzIndex @DatabaseName = 'AM2', @TableName = 'AwesomeSauce'

I care about that one table because it's the one my query is touching. I want ALL the index info on that ONE table. Right now, I'm missing the data compression info.

Ideally, if I decide I need to modify an index, I'd love to be able to grab the Create TSQL, modify that, and run it with DROP_EXISTING...without accidentally removing compression (again).

amtwo avatar Jul 06 '16 20:07 amtwo

Oh sure, how about we add a column for compression type in the index list? We already have that data available and it'd be easier to parse visually.


Tiny glass keyboard Typos flowing like rivers As winter snow thaws

On Jul 6, 2016, at 3:24 PM, amtwo [email protected] wrote:

My favorite magic incantation is to do something like this while troubleshooting/performance tuning/whatever: EXEC dbo.sp_BlitzIndex @DatabaseName = 'AM2', @TableName = 'AwesomeSauce'

I care about that one table because it's the one my query is touching. I want ALL the index info on that ONE table. Right now, I'm missing the data compression info.

Ideally, if I decide I need to modify an index, I'd love to be able to grab the Create TSQL, modify that, and run it with DROP_EXISTING...without accidentally removing compression (again).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

BrentOzar avatar Jul 06 '16 20:07 BrentOzar

That'd work.

amtwo avatar Jul 07 '16 01:07 amtwo

@amtwo @BrentOzar

In the case of partitioning, we don't list out every partition for a specific table, and the results come back as a csv.

image

For non-partitioned tables, it comes back as a single value:

image

Does this work for you guys?

BlitzErik avatar Jul 13 '16 15:07 BlitzErik

The CSV for partitioned tables is a bit hard to read/interpret--I'm thinking of the scenario where the current/active partition uses a different compression level than older/archive partitions.

Say there's one "NONE" and 16 "PAGE" ...From the CSV, it's not really clear which one is the odd-ball. From that regard, I wonder if it would be just as useful, but more legible to display as: "NONE, PAGE" or "NONE(1), PAGE(16)"

But I'm complaining about a corner case. The way you have it looks good enough.

The "Is Compressed?" column name seems wonky. Pedantic Andy would name the

column "Compression Level".


twitter: @amtwo blog: www.am2.co linkedin: www.linkedin.com/in/amtwo

amtwo avatar Jul 13 '16 16:07 amtwo

I can get better presented information out, I think. Need to think about how. I can get things here pretty easily:

image

But for a bunch of partitions, that gets out of control pretty fast:

image

I know I can do better, just have to think about where to do that so I end up with something like

Partitions 1-N use X compression, Partitions N-N use X compression or something. Getting partition information is already pretty slow when you hit thousands of them.

BlitzErik avatar Jul 13 '16 16:07 BlitzErik

Bam-a-lam

image

BlitzErik avatar Jul 13 '16 19:07 BlitzErik

I like that! The output is only as complex as your compression-partitioning scheme.

I appreciate your careful & thoughtful use of singular/plural on the word "Partition". Bonus points on that.

amtwo avatar Jul 13 '16 19:07 amtwo

Hahaha. Thanks. It always drives me nuts when that's not correct. If you want to test this out, the branch lives here: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/tree/BlitzIndex_Erik_Issue_351

BlitzErik avatar Jul 13 '16 19:07 BlitzErik

Out for testing in #373

BlitzErik avatar Jul 13 '16 19:07 BlitzErik

Merged in with dev branch, but leaving it open in case anybody wants to test.

BrentOzar avatar Jul 14 '16 20:07 BrentOzar