← ClaudeAtlas

yugabytedb-schema-designlisted

Design and review high-performance YugabyteDB YSQL schemas. Covers hash vs range sharding, write hotspots on sequential columns, partial indexes for nullable or skewed columns, low-cardinality indexes, covering indexes, primary keys, foreign key indexes, and redundant index cleanup. Includes read-only scripts and an offline analyzer that review an existing database from its catalog, pg_stats, pg_stat_statements or statements.json. Use this skill when the user asks how to design a YugabyteDB schema, choose a sharding key, avoid hotspots, optimize indexes, or model tables for distributed SQL; or wants an existing YSQL database reviewed or audited (redundant/unused indexes, HASH timestamp columns, low-cardinality hash keys, missing FK indexes), live or from a schema dump, stats export or statements.json. Trigger on "YugabyteDB indexes", "YSQL schema", "tablet hotspot", "sharding key", or slow or skewed YugabyteDB writes.
srinivasa-vasu/agent-skills · ★ 3 · API & Backend · score 60
Install: claude install-skill srinivasa-vasu/agent-skills
# YugabyteDB Schema Design Best Practices This skill covers **how to design schemas well** for YugabyteDB: the design patterns that make a schema performant in a distributed SQL environment. ## Two Modes - **Design mode**: the user is designing or changing tables and indexes. Use the reference files below and the golden rules. - **Review mode**: the user wants an *existing* database reviewed: live (you may connect) or offline (they have, or can produce, a schema dump / stats export / statements file). Read `references/review-mode.md` first. It covers the bundle, safety rules, the scripts, how to triage the analyzer's findings, and the rollout runbook. Never run DDL or `ANALYZE` against the user's database. Changes go into two phased change sets with their rollbacks: `changes-minimal.sql` (access paths and waste) and `changes-ideal.sql` (also removes write hot spots), rendered from the triaged `findings.json` so the SQL always matches the report; where the two sets differ, the report shows both, and a finding's `"profile"` moves it between them. With statements (`pg_stat_statements` or tserver `:13000/statements`), the analyzer also checks each query's conditions against the PK and indexes, weighted by calls and mean time; its proposed indexes go in the runnable `workload` phase. A statements file spanning several databases needs `--database NAME`. Every change is checked against the end state: no proposal duplicates an existing index, a reshaped p