Token导航 LogoToken导航

Agent Skill · 待分类

oceanbase-schema-design(Oceanbase 架构设计)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

oceanbase-schema-design 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 8,318。

总安装 306周安装 13GitHub Stars 6下载 107核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:oceanbase-schema-design(Oceanbase 架构设计)
来源仓库:https://github.com/amber-moe/oceanbase-doc-skills
仓库路径:skills/oceanbase-schema-design
安装命令:
npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-schema-design
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-schema-design

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

用于辅助界面设计、视觉规范和交互体验优化,适合生成 UI 方案或检查一致性。适用于产品页面布局、组件层级设计和品牌视觉系统构建等场景。使用时需结合现有设计系统和用户任务,避免堆砌装饰元素。涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出和对齐表现。

oceanbase-schema-design 属于待分类类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/oceanbase-schema-design

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanba…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

oceanbase-schema-design 怎么安装?

在终端执行 npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-schema-…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

oceanbase-schema-design 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

oceanbase-schema-design 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

oceanbase-schema-design 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

oceanbase-schema-design 用的人多吗?

公开数据是累计安装 306 次,近一周安装 13 次,下载 107 次,GitHub 6 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

oceanbase-schema-design 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
oceanbase-schema-design

Oceanbase 架构设计 · 本页

3066只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

OceanBase Schema Design Skill

Expert in database schema design for OceanBase distributed database (MySQL & Oracle modes).

Provides best practices for designing efficient table structures, partitioning strategies, table groups, indexes, and schema optimization in OceanBase. This skill covers both MySQL mode and Oracle mode.


Mode-specific syntax guide

While OceanBase uses the same underlying storage and partitioning mechanisms for both MySQL and Oracle modes, there are important syntax differences:

AspectMySQL ModeOracle Mode
Data TypesBIGINT, VARCHAR, DATETIMENUMBER, VARCHAR2, DATE, TIMESTAMP
Schema Accessdatabase.tableschema.table
Default IndexLOCAL (for partitioned tables)GLOBAL (for partitioned tables)
Time FunctionsNOW(), CURRENT_TIMESTAMPSYSDATE, SYSTIMESTAMP
String FunctionsCONCAT()`\\` operator

Design Principles:

  • ✅ Same: Partitioning types, table group concepts, index types
  • ✅ Same: Design best practices, normalization principles
  • ❌ Different: Data type names, default index behavior, function syntax

Examples in this skill are marked with mode indicators: MySQL Mode: or Oracle Mode:


Table design fundamentals

Database normalization

Three Normal Forms:

  • 1NF: All field values must be atomic (indivisible)
  • 2NF: Every column must be fully dependent on the primary key
  • 3NF: No transitive dependencies (columns must be directly dependent on primary key)

Important: Schema design should prioritize business performance over strict normalization. Appropriate data redundancy is acceptable to reduce table joins and improve performance. Redundancy fields should not be frequently modified and not be very long VARCHAR fields.

Table structure design standards

1. Primary key design:

-- ✅ GOOD: Use business fields as primary key
obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT PRIMARY KEY,
                     customer_id BIGINT NOT NULL,
                     gmt_create TIMESTAMP DEFAULT CURRENT_TIMESTAMP,  -- MySQL: CURRENT_TIMESTAMP, Oracle: SYSDATE
                     gmt_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
                     ) COMMENT='Order table';

-- ✅ GOOD: Composite primary key
obclient [SALES_DB]> CREATE TABLE order_item_table (
                     order_id BIGINT,
                     item_id BIGINT,
                     PRIMARY KEY (order_id, item_id)
                     );

Key points:

  • OceanBase uses Index-Organized Table (IOT) model
  • If no primary key is specified, system automatically generates a hidden primary key
  • Recommend using business fields as primary key (avoid auto-increment)
  • Include required fields: gmt_create, gmt_modified
  • All fields should have COMMENT attributes and be NOT NULL with appropriate DEFAULT values
  • Use TINYINT UNSIGNED for boolean fields (1=yes, 0=no)
  • Join fields must have consistent data types to avoid implicit conversion

Partition design

When to use partitioning

Use partitioning when:

  • Data volume is large and access is concentrated
  • Table is a history table or transaction log table
  • Table has obvious access hotspots
  • Need to improve query performance through partition pruning

Partition key selection

Critical Rule:

  • For partitioned tables, every primary key and unique key must include at least one field that is part of the partition key

Partition key selection principles:

  • Hash partition: Choose high cardinality field that appears most frequently in WHERE clauses (e.g., User ID, Order ID)
  • Range/List partition: Choose fields based on business rules (e.g., time-based for log tables), partition count should not be too small
-- ✅ GOOD: Hash partition on high-cardinality field
obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT PRIMARY KEY,
                     customer_id BIGINT,
                     order_date DATE
                     ) PARTITION BY HASH(order_id) PARTITIONS 8;

-- ✅ GOOD: Range partition for time-based data
obclient [SALES_DB]> CREATE TABLE order_log_table (
                     log_id BIGINT,
                     log_date DATE NOT NULL,
                     PRIMARY KEY (log_id, log_date)
                     ) PARTITION BY RANGE COLUMNS(log_date) (
                     PARTITION p202401 VALUES LESS THAN('2024-02-01'),
                     PARTITION p202402 VALUES LESS THAN('2024-03-01'),
                     PARTITION pMAX VALUES LESS THAN MAXVALUE
                     );

Limitations: Hash partition is not suitable for range queries on partition key. Range partition is better for time-based queries.

Partition types

Supported partition types:

  • Hash: Even data distribution, point queries (high cardinality field)
  • Range: Time-based data, historical data (date or numeric with clear ranges)
  • List: Discrete value sets (field with limited distinct values)
  • Key: Similar to Hash, uses MySQL's internal hashing function
  • Composite: Combines two partition types (e.g., Hash + Range)
-- Hash partition
obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT PRIMARY KEY,
                     customer_id BIGINT
                     ) PARTITION BY HASH(order_id) PARTITIONS 8;

-- Range partition
obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT,
                     order_date DATE NOT NULL,
                     PRIMARY KEY (order_id, order_date)
                     ) PARTITION BY RANGE COLUMNS(order_date) (
                     PARTITION p2024Q1 VALUES LESS THAN('2024-04-01'),
                     PARTITION p2024Q2 VALUES LESS THAN('2024-07-01'),
                     PARTITION pMAX VALUES LESS THAN MAXVALUE
                     );

-- Composite partition (Hash + Range)
obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT,
                     customer_id BIGINT,
                     order_date DATE NOT NULL,
                     PRIMARY KEY (order_id, customer_id, order_date)
                     ) PARTITION BY HASH(customer_id) PARTITIONS 8
                     SUBPARTITION BY RANGE COLUMNS(order_date) (
                     PARTITION p0 (
                         SUBPARTITION sp0_q1 VALUES LESS THAN('2024-04-01'),
                         SUBPARTITION sp0_q2 VALUES LESS THAN('2024-07-01')
                     )
                     -- ... more partitions
                     );

Partition pruning

Partition pruning avoids accessing irrelevant partitions, significantly improving SQL execution efficiency.

Rules:

  • Hash/List: Partition key must be in WHERE clause with equality or IN conditions
  • Range: Use range conditions that match partition boundaries, avoid functions on partition keys
-- ✅ GOOD: Partition pruning works
obclient [SALES_DB]> SELECT * FROM order_table WHERE order_id = 12345;
-- Execution plan shows: partitions(p1) - only one partition accessed

-- ❌ BAD: No partition pruning (missing partition key or function on partition key)
obclient [SALES_DB]> SELECT * FROM order_table WHERE customer_id = 1001;
-- Execution plan shows: all partitions scanned

Table group design

Table group overview

Table Group is a logical concept representing a collection of tables. It controls the physical storage proximity of related tables to enable Partition Wise Join.

SHARDING attributes

1. SHARDING = 'NONE': All partitions co-located on same machine, no partition restrictions

2. SHARDING = 'PARTITION': Tables sharded by first-level partitions, all tables must have identical first-level partition definitions

3. SHARDING = 'ADAPTIVE' (Default): Tables sharded adaptively, enables Partition Wise Join for both first-level and second-level partitions

Use table groups when: Multiple tables are frequently joined together, tables have related partition keys, need to avoid cross-partition joins

-- Create table group and add tables
obclient [SALES_DB]> CREATE TABLEGROUP order_tg SHARDING = 'PARTITION'
                     PARTITION BY HASH(customer_id) PARTITIONS 8;

obclient [SALES_DB]> CREATE TABLE order_table (
                     order_id BIGINT,
                     customer_id BIGINT,
                     PRIMARY KEY (order_id, customer_id)
                     ) PARTITION BY HASH(customer_id) PARTITIONS 8;

obclient [SALES_DB]> ALTER TABLE order_table SET TABLEGROUP order_tg;
-- Now JOIN queries can use Partition Wise Join

Index design

Index types

1. Local Index (LOCAL):

  • Index data stored with table partition data
  • Default for MySQL mode partitioned tables
  • Better for DML performance, preferred choice

2. Global Index (GLOBAL):

  • Index separately partitioned
  • Default for Oracle mode partitioned tables
  • May cause distributed transactions, use only when necessary
-- MySQL Mode: Default is LOCAL
obclient [SALES_DB]> CREATE INDEX idx_customer_date ON order_table(customer_id, order_date);
-- Creates LOCAL index by default

-- Create GLOBAL index explicitly
obclient [SALES_DB]> CREATE INDEX idx_customer_date ON order_table(customer_id, order_date) GLOBAL;

Index design principles

1. Leftmost prefix principle: Index must match query pattern from leftmost column

-- ✅ GOOD: Index matches query
obclient [SALES_DB]> CREATE INDEX idx_customer_date ON order_table(customer_id, order_date);
obclient [SALES_DB]> SELECT * FROM order_table
                     WHERE customer_id = 1001 AND order_date >= '2024-01-01';

-- ❌ BAD: Missing leftmost column prevents index usage
obclient [SALES_DB]> SELECT * FROM order_table WHERE order_date >= '2024-01-01';
-- Execution plan shows: TABLE SCAN (full table scan)

2. Composite index column order: Place high cardinality columns first

-- ✅ GOOD: High cardinality column first
obclient [SALES_DB]> CREATE INDEX idx_customer_date ON order_table(customer_id, order_date);

3. Covering index: Include all query columns to avoid table lookup

obclient [SALES_DB]> CREATE INDEX idx_customer_date_amount ON order_table(customer_id, order_date)
                     STORING (total_amount, status);

4. ORDER BY optimization: Index can support ORDER BY if WHERE conditions match leftmost columns

5. Join field indexes: Always index join columns for efficient joins

Index design best practices

General principles:

  • Indexed fields should be NOT NULL with appropriate DEFAULT values
  • Business-unique fields should be primary keys
  • Join fields must have consistent data types
  • Place high cardinality columns first in composite indexes
  • Use single composite index instead of multiple single-column indexes
  • Add ORDER BY/GROUP BY columns to index for covering index

Partitioned table index:

  • Prefer LOCAL index → Global partitioned index → Global index
  • Reduce unnecessary global indexes (high maintenance cost)
  • Primary key must include partition key

Index maintenance:

  • Confirm new index is effective before deploying SQL
  • Index modification: Create new index → Verify → Delete old index
  • Delete unused indexes to avoid index bloat
  • Never mix ALTER TABLE ADD INDEX and DROP INDEX in one DDL

Common mistakes to avoid:

  • ❌ Creating one index per query
  • ❌ Believing indexes severely slow down updates
  • ❌ Using "check then insert" instead of unique indexes
  • ❌ Creating redundant indexes (e.g., idx_abc already covers idx_a and idx_ab)

Schema design checklist

Before deploying a table schema to production:

  • Primary key defined (preferably business fields)
  • Required fields included (gmt_create, gmt_modified)
  • All fields have COMMENT attributes and are NOT NULL with DEFAULT values
  • Join fields have consistent data types
  • Partition key selected appropriately and included in primary key/unique key
  • Table group created if tables are frequently joined
  • Indexes designed following leftmost prefix principle, on join columns
  • LOCAL index preferred for partitioned tables, no redundant indexes
  • Schema tested with production-like data volume

Quick reference

Partition types: Hash (even distribution, point queries) | Range (time-based data) | List (discrete value sets) | Key (similar to Hash) | Composite (two partition types)

Table group SHARDING: NONE (no restriction) | PARTITION (first-level partitions must match) | ADAPTIVE (all first-level or all second-level must match)

Index types: LOCAL (default MySQL, better DML performance) | GLOBAL (default Oracle, cross-partition queries)

平台分布

Codex

35.93%
按下载量换算38

Claude

33.51%
按下载量换算36

Cursor

18.14%
按下载量换算19

Gemini CLI

8.69%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills