alibabacloud-polardbx-sql — Claude Code skill
alibabacloud-polardbx-sql — a skill for writing SQL on distributed PolarDB-X 2.0 Enterprise Edition databases in AUTO mode, designing partition schemes, and avoiding MySQL incompatibilities.
no license 180 installs ★ 300 updated 2026-10-23
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a claude-codeWhat alibabacloud-polardbx-sql does
This skill targets PolarDB-X 2.0 Enterprise Edition in AUTO mode, where tables use standard PARTITION BY syntax. If your database runs DRDS mode or Standard Edition, the skill refuses and directs you to the right tool.
The skill provides logic to select partition keys by analyzing query frequency, cardinality, and hotspot risk; create global indexes (GSI and CCI); convert single-node tables to partitioned ones; and handle Sequence, table groups, and TTL. It teaches how to write queries that avoid full-cluster scans and handles pagination via Keyset.
Before any operation, the skill requires explicit confirmation of connection parameters: host, port, user, password, and database name. Commands do not execute without approval.
What it helps with
- Design a partition scheme for a large table so queries hit one or a few shards instead of scanning the entire cluster
- Choose a partition key from multiple candidates by analyzing SQL patterns and data distribution
- Convert a MySQL table to a PolarDB-X partitioned table without data loss
- Create a global index (GSI or CCI) to speed up queries on non-partition-key fields
- Diagnose slow queries and understand why they trigger full-cluster scans
Example prompts for the agent
- Help me pick the right partition key for an
orderstable based on its query patterns - Write SQL to convert my single
userstable to a partitioned table sharded byregion_idin AUTO mode - Why does a query on
created_atin theproductstable scan all shards, and how do I speed it up with GSI?
How to install alibabacloud-polardbx-sql
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a claude-code2Manually: put the files in place
~/.claude/skills/alibabacloud-polardbx-sql/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/alibabacloud-polardbx-sql/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a codex2Manually: put the files in place
.agents/skills/alibabacloud-polardbx-sql/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a cursor2Manually: put the files in place
.cursor/skills/alibabacloud-polardbx-sql/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aliyun/alibabacloud-aiops-skills skills/database/drds/alibabacloud-polardbx-sql2Manually: put the files in place
.github/skills/alibabacloud-polardbx-sql/SKILL.md1Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a gemini-cli2Platform CLI
gemini skills install https://github.com/aliyun/alibabacloud-aiops-skills --path skills/database/drds/alibabacloud-polardbx-sqlManually: put the files in place
.devin/skills/alibabacloud-polardbx-sql/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about alibabacloud-polardbx-sql
How do I install alibabacloud-polardbx-sql in Claude Code?
Run npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-polardbx-sql -a claude-code, then check ~/.claude/skills/alibabacloud-polardbx-sql/SKILL.md.
What does alibabacloud-polardbx-sql do?
It helps design partitions, choose partition keys, create GSI/CCI indexes, and write SQL for PolarDB-X 2.0 Enterprise Edition in AUTO mode while accounting for differences from MySQL.
Does this skill work with PolarDB-X 1.0 or Standard Edition?
No. The skill is for PolarDB-X 2.0 Enterprise Edition in AUTO mode only. For DRDS 1.0 or Standard Edition, the skill refuses and recommends the correct tool.