v.18.16New Feature
Added Key Columns to system.tables for Table Key Information
Added thepartition_key,sorting_key,primary_key, andsampling_keycolumns to thesystem.tablestable in order to provide information about table keys. #3609
Why it matters
This feature addresses the need for better introspection of table key structures by exposing key definitions directly in thesystem.tables metadata table. It enables users and administrators to easily query and understand the partition, sorting, primary, and sampling keys of tables without inspecting table definitions or schema files, thus improving database management and optimization processes.How to use it
Users can query thesystem.tables table and check the new columns partition_key, sorting_key, primary_key, and sampling_key to get information about the respective keys for any table. For example:SELECT database, name, partition_key, sorting_key, primary_key, sampling_key
FROM system.tables
WHERE database = 'your_database_name';