v.23.7Improvement

Add primary_key_size column to system.parts table

Add column primary_key_size to system.parts table to show compressed primary key size on disk. Closes #51400. #51496 (Yarik Briukhovetskyi).
Added a new column primary_key_size to the system.parts table that displays the compressed size of the primary key on disk.

Why it matters

This feature helps users monitor and analyze the disk space used specifically by the compressed primary keys within table parts, enabling better storage management and performance tuning.

How to use it

Query the system.parts table and include the primary_key_size column in your SELECT statement to view the compressed primary key size for each part, for example:

SELECT part, primary_key_size FROM system.parts;