ysql

Apply best-practice guidance for designing, reviewing, and operating YugabyteDB YSQL workloads.

6|4|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/yugabyte/yugabytedb-skills --skill ysql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ysql
Source: https://github.com/yugabyte/yugabytedb-skills/tree/main/skills/ysql
Command: npx skills add https://github.com/yugabyte/yugabytedb-skills --skill ysql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps teams design, review, and operate YugabyteDB's YSQL PostgreSQL-compatible workloads by codifying best practices for schema design, indexing, migrations, and transactional patterns.

Core Features & Use Cases

  • Schema design guidance for YSQL, including primary key strategies and sharding considerations.
  • Indexing strategies, including covering and partial indexes, to optimize read performance.
  • PostgreSQL migration patterns, transaction retry guidance, and operational checklists for production deployments.
  • Use Case: Migrate an existing PostgreSQL application to YugabyteDB YSQL with safe online schema changes and optimized query performance.

Quick Start

Review the YugabyteDB YSQL guidance and apply the recommended schema, indexing, and migration patterns to your project.

Frequently Asked Questions about ysql

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

FAQPage Schema
How do I design a schema for YugabyteDB YSQL to handle sharding and primary keys?

Schema design for YugabyteDB YSQL requires choosing natural primary keys and applying hash-based sharding options to distribute data evenly. Structured guidance provides example schemas covering these sharding considerations to optimize distributed workloads.

What are the best indexing strategies for optimizing PostgreSQL-compatible workloads in YSQL?

Indexing strategies for YSQL workloads include using covering indexes and partial indexes to optimize read performance. Applying these patterns helps reduce remote reads by including needed columns directly in the index structure.

How do I safely migrate an existing PostgreSQL application to YugabyteDB?

Migrating a PostgreSQL application to YugabyteDB involves applying safe migration patterns for production deployments. This includes following operational checklists for online schema changes and adapting transaction retry logic for distributed databases.

How do transaction retries work in YugabyteDB YSQL deployments?

Transaction retry guidance for YSQL deployments helps manage conflicts in distributed transactions. Applying the recommended retry patterns ensures application stability when concurrent operations encounter serialization failures.

When should I use partial indexes versus covering indexes in YSQL schema design?

Partial indexes in YSQL optimize queries targeting specific subsets of data, while covering indexes bundle additional columns to avoid table lookups. Schema design guidance helps choose the right approach based on specific read patterns.