oceanbase-schema-design

Design OceanBase schemas with primary keys, partitions, and indexes.

9|1|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-schema-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oceanbase-schema-design
Source: https://github.com/amber-moe/oceanbase-doc-skills/tree/main/skills/oceanbase-schema-design
Command: npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-schema-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

OceanBase schema design is essential to ensure scalable performance and maintainability. This skill provides a structured set of best practices for designing efficient tables, partitions, table groups, and indexes across OceanBase's MySQL and Oracle modes.

Core Features & Use Cases

  • Table design fundamentals: primary keys, data types, not nulls, and meaningful column comments for maintainability.
  • Partitioning & table groups: guidance on when to partition, how to choose hash/range/list keys, and how to organize tables into groups for performance.
  • Index design & optimization: leftmost prefix rules, covering indexes, and partition-aware indexing strategies.
  • Real-world scenarios: design a customer orders schema with PKs, partitioning, and indexing that supports high-throughput queries.

Quick Start

Apply the guidelines to a sample OceanBase schema by defining PKs, partitioning, and indexes consistent with the best-practice rules.

Frequently Asked Questions about oceanbase-schema-design

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

FAQPage Schema
How do I design an OceanBase database schema for high-performance workloads?

To design an OceanBase database schema for high performance, you must enforce proper primary keys, include partition keys, apply partition-aware indexing, and balance normalization. This ensures scalable performance and maintainability across MySQL and Oracle modes.

What is the best way to choose partition keys for OceanBase tables?

Choosing partition keys for OceanBase tables requires deciding between hash, range, or list partitioning based on query patterns. You must ensure the partition key is included in the primary key and use table groups to organize related partitions for performance.

How do I apply leftmost prefix rules and covering indexes in OceanBase?

Applying leftmost prefix rules and covering indexes in OceanBase involves structuring index columns to match query filters exactly. You must also use partition-aware indexing strategies to ensure indexes align with table partitions for high-throughput queries.

Does OceanBase schema design work with both MySQL and Oracle modes?

Yes, OceanBase schema design works with both MySQL and Oracle modes. It provides structured best practices for defining tables, partitions, table groups, and indexes that enforce primary key and partition key requirements across both compatibility modes.

When should I group OceanBase tables into table groups?

You should group OceanBase tables into table groups when you need to optimize performance for related partitioned tables. Table groups organize tables so that partitions with similar data are located together, reducing cross-node query overhead.

What primary key requirements must I follow when creating OceanBase tables?

When creating OceanBase tables, primary key requirements mandate that every table has a proper primary key and that the partition key is included within it. You must also enforce not nulls and meaningful column comments for maintainability.