db-keys

Evaluate primary-key usage in relational database schemas by parsing DDL statements.

18|4|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/Hainrixz/claude-db --skill db-keys
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-keys
Source: https://github.com/Hainrixz/claude-db/tree/main/skills/db-keys
Command: npx skills add https://github.com/Hainrixz/claude-db --skill db-keys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill unit provides a thorough audit of your database primary-key strategy, ensuring optimal design and performance.

Core Features & Use Cases

  • Audit Primary-Key Strategy: Evaluate and analyze the primary-key usage for integrity and performance issues.
  • Design & Integrity Score: Measures how well the primary-key is designed and ensures data integrity.
  • Performance & Scale Score: Assesses the performance implications of primary-key usage on scaling and query efficiency.
  • Use Case: Identify tables with missing or inappropriate primary keys, such as using UUIDv4 as a clustered index, or exhausting int4 serial columns, to prevent future issues and improve database performance.

Quick Start

Use the db-keys skill to analyze your database primary keys for potential problems.

Frequently Asked Questions about db-keys

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit my database primary-key strategy for performance and integrity?

To audit a database primary-key strategy, parse DDL statements to evaluate primary-key definition and usage, generating design integrity and performance scores to identify scaling or query efficiency issues.

When should I avoid using UUIDv4 as a clustered index in a relational database?

Avoid UUIDv4 as a clustered index when scaling relational databases, because random UUID insertion causes fragmentation and degrades write performance; instead, choose sequential UUIDs or integers based on data volume.

How does integer width choice affect primary-key performance for large data volumes?

Integer width choice directly impacts primary-key performance because exhausting an int4 serial column limits data volume capacity; evaluating table behavior and data volume helps select the correct integer width to prevent future exhaustion.

Can I check my existing database schema for missing or inappropriate primary keys?

Yes, you can check a database schema for missing or inappropriate primary keys by parsing DDL statements to detect tables lacking proper primary-key definitions, ensuring data integrity and preventing future database performance issues.

What is the best way to optimize primary-key usage for database scaling?

The best way to optimize primary-key usage for database scaling is to evaluate UUID and integer width choices against actual data volume and table behavior, ensuring the clustered index supports efficient query scaling.