database-optimization-commerce

database-optimization-commerce is a skill for Claude Code, Codex from finsilabs/awesome-ecommerce-skills. It costs 28 tokens per session (2,387 once invoked), scanned A, original, MIT.

A database-performance guide for making product and order queries faster through indexes, query analysis, read replicas, and search-system offloading.

In plain words
What is it for?
Use it to improve product filtering, checkout inserts, large-table queries, database schemas, and traffic distribution between primary and replica databases.
Why use it?
It helps diagnose slow queries, reduce database pressure, and prevent read traffic from delaying order writes in custom e-commerce systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions Gemini CLI; mentions OpenCode.

Good fit Use it to improve product filtering, checkout inserts, large-table queries, database schemas, and traffic distribution between primary and replica databases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add finsilabs/awesome-ecommerce-skills --skill database-optimization-commerce
Clone the repo
git clone --depth 1 https://github.com/finsilabs/awesome-ecommerce-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-optimization-commerce

README.md
[![agentmods](https://agentmods.dev/badge/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce/github.svg)](https://agentmods.dev/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce)
Your own site
<a href="https://agentmods.dev/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce"><img src="https://agentmods.dev/badge/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-optimization-commerce

Your own site · 80×15
<a href="https://agentmods.dev/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce"><img src="https://agentmods.dev/badge/skills/finsilabs/awesome-ecommerce-skills/database-optimization-commerce.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,387 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.02387
Opus 5 $0.00014 $0.01193
Sonnet 5 $0.00006 $0.00477
Haiku 4.5 $0.00003 $0.00239

Measured 9d ago against content hash 182fd3ac7b16, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

database-optimization-commerce scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/infrastructure-performance/database-optimization-commerce/SKILL.md · 236 lines

How it starts

The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Optimization — Commerce

Overview

E-commerce databases face distinct query patterns: high-cardinality product filtering (category + price + attributes), session-scoped cart lookups, write-heavy order creation, and read-heavy catalog browsing that must scale to concurrent users. This skill covers identifying slow queries, designing effective indexes for product filtering, partitioning order tables, and routing read traffic to replicas.

When to Use This Skill

  • When product listing pages are slow due to unindexed filter combinations (category + price + brand)
  • When checkout throughput is limited by order insertion latency
  • When read load on the primary database is causing write latency to increase
  • When a slow query log reveals queries doing sequential scans on large tables
  • When planning a database schema for a new custom e-commerce platform

Core Instructions

Step 1: Determine your situation

Database optimization applies primarily to self-hosted setups. Understand your constraints first:

Platform Database Control What to Optimize
Shopify None — Shopify manages all infrastructure Focus on Liquid template rendering speed, app performance, and Shopify's built-in query optimization via Search & Discovery app
WooCommerce Full — you manage MySQL/MariaDB on your host Optimize WooCommerce queries with caching plugins (Redis Object Cache, WP Rocket), add database indexes via WP Optimize plugin, and configure your hosting MySQL settings
BigCommerce None — BigCommerce manages all infrastructure Focus on theme performance, image optimization, and reducing third-party app overhead
Custom / Headless Full — you own PostgreSQL (or MySQL) Apply all the techniques below; PostgreSQL is assumed in code examples

Step 2: Quick wins for WooCommerce (managed WordPress/WooCommerce)

Before touching database indexes directly, apply these WooCommerce-specific optimizations:

Read the full file on GitHub · 236 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 236 lines · 28 tokens per session scan A 182fd3ac7b16

Subscribe to this mod's changes

database-optimization-commerce is a skill published in the GitHub repository finsilabs/awesome-ecommerce-skills (52 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 2,387 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

PostgreSQL Performance Optimization

Production-grade PostgreSQL query optimization, indexing strategies, performance tuning, and modern features including pgvector for AI/ML workloads. Master EXPLAIN plans, query analysis, and database design for high-performance applications.

bobmatnyc/mcp-skillset · 47 tokens

postgres-commit-history-article

A workflow for comparing PostgreSQL source-code changes between two Git commits and, when useful, writing a Chinese Markdown article about them. PostgreSQL is a database system, and a commit is a saved change in a Git repository.

digoal/blog · 127 tokens

Elasticsearch Testing Patterns

Elasticsearch testing including index management, query validation, mapping verification, bulk operation testing, and search relevance scoring.

PramodDutta/qaskills · 27 tokens

sql-expert

Expert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server. Use when the user mentions database, PostgreSQL, MySQL, or query optimization, or when the task involves Database Design, Advanced Queries, Indexes and Performance, or Transactions and Concurrency.

personamanagmentlayer/pcl · 66 tokens

elasticsearch

Configure Elasticsearch mappings and ingest pipelines, investigate cluster health and queries, and plan reindexing or lifecycle changes.

alivirgo/Major-AI-Skills · 25 tokens

database-engineer

!cat skills/shared/protocols/ux-protocol.md 2>/dev/null || true !cat skills/shared/protocols/input-validation.md 2>/dev/null || true !cat skills/shared/protocols/tool-efficiency.md 2>/dev/null || true !cat .production-grade.yaml 2>/dev/null || echo "No config — using defaults" !cat .forgewright/codebase-context.md…

buiphucminhtam/forgewright · 45 tokens