CockroachDB Videos
← Back to all videos

CockroachDB Performance: Hash Shard Columns

2026-05-14

Demos & Tutorials

Description

If you're storing time-series data or migrating to CockroachDB from a database that uses monotonically incrementing IDs (like MySQL or PostgreSQL) you've probably run into write hotspots and the painful tradeoffs that come with solving them. CockroachDB v26.2 introduces shard columns, a smarter approach to hash sharding that gives you the best of both worlds. In this video, you'll learn: - Why sequential keys like timestamps naturally cause hotspots in distributed databases - How standard hash sharding solves write distribution - but creates costly scatter-gather reads - How shard columns let you hash only a prefix of your index key (e.g. a sensor ID), keeping writes distributed while preserving sequential ordering within each bucket - When to use shard columns vs. standard hash sharding - and when not to bother Shard columns work on both primary key indexes and secondary indexes, making this a flexible solution for a wide range of workloads. 00:00 - Overview and introduction into hash sharding 00:55 - Demonstration of range sharding without hashing 02:09 - Traditional hash sharding (pre-v26.2) 04:05 - Introduction of the new shard columns feature in version 26.2 05:48 - Summary Learn more: https://www.cockroachlabs.com/product/overview/ #CockroachDB #distributedsql #database