sql-optimization-patterns – skill Dữ liệu & Khoa học cho agent AI
Chẩn đoán SQL chậm bằng query plan, giữ nguyên kết quả truy vấn và xác minh thay đổi chỉ mục hoặc truy vấn trên dữ liệu đại diện.
Cài skill sql-optimization-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/sql-optimization-patterns-b5ef1.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /sql-optimization-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/sql-optimization-patterns-b5ef1.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $sql-optimization-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/sql-optimization-patterns-b5ef1.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /sql-optimization-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/sql-optimization-patterns-b5ef1.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /sql-optimization-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
SQL Optimization Patterns
Diagnose slow SQL with query plans, preserve query results, and verify indexing or query changes against representative data.
Use this skill when
- Debugging slow-running queries
- Designing performant database schemas
- Optimizing application response times
- Reducing database load and costs
- Improving scalability for growing datasets
- Analyzing EXPLAIN query plans
- Implementing efficient indexes
- Resolving N+1 query problems
Do not use this skill when
- The task is unrelated to sql optimization patterns
- You need a different domain or tool outside this scope
Instructions
- Confirm database engine/version, query parameters, expected rows, data distribution and the permitted environment. Start read-only; obtain authorization before DDL, data changes, configuration changes or maintenance.
- Compare result sets before comparing performance. EXPLAIN ANALYZE executes the statement: use approved representative data, account for functions and triggers, and do not assume a transaction rollback undoes every side effect.
- Record the observed plan, timing conditions and correctness checks. Indexes and query rewrites are hypotheses, not universal speed improvements.
- If detailed examples are required, open
resources/implementation-playbook.md.
Resources
resources/implementation-playbook.mdfor detailed patterns and examples.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Worked example
The playbook includes an executable SQLite batch-loading example with bound values and an empty-input case. The repository test exercises it alongside pagination ties and aggregation equivalence. SQLite correctness checks do not establish PostgreSQL performance or production safety.
Skill liên quan
- sql-pro – Thành thạo SQL hiện đại với cơ sở dữ liệu cloud-native, tối ưu OLTP/OLAP và kỹ thuật…
- sql-sentinel – Kiểm tra SQL để tìm các anti-pattern về chi phí và hiệu năng làm tốn credit kho dữ liệu…
- sqlmap-database-pentesting – Cung cấp phương pháp có hệ thống để phát hiện và khai thác SQL injection tự động bằng…
- startup-analyst – Chuyên gia phân tích kinh doanh startup, chuyên về ước lượng thị trường, mô hình tài…
- startup-business-analyst-market-opportunity – Tạo phân tích cơ hội thị trường toàn diện với phép tính TAM/SAM/SOM
- startup-financial-modeling – Xây dựng mô hình tài chính toàn diện 3-5 năm với dự báo doanh thu, cấu trúc chi phí…
- statsmodels – Statsmodels là thư viện hàng đầu của Python về mô hình hóa thống kê, cung cấp công cụ…
- stride-analysis-patterns – Áp dụng phương pháp STRIDE để xác định có hệ thống các mối đe dọa. Dùng khi phân tích…