Db optimization
Skill henriquescastilho/my-claude/.claude/skills/db-optimization
Otimizacao de banco de dados, caching, queries, indices. Usar automaticamente quando trabalhar com Supabase, Postgres, Firebase, ou quando performance de queries for relevante.From its SKILL.md
npx -y skills add henriquescastilho/my-claude --skill db-optimizationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 313 tokens by cl100k_base, as published. Nobody here has run it
Otimizacao de Banco de Dados -- Padrao DME
Stacks de DB na DME
| Servico | Quando usar |
|---|---|
| Supabase (Postgres) | Maioria dos projetos web, RLS, auth integrado |
| Firebase Firestore | Mobile-first, real-time sync |
| Postgres direto | Backend pesado, queries complexas |
Checklist de performance
- Indices em colunas filtradas e ordenadas
- EXPLAIN ANALYZE em queries lentas
- Paginacao com cursor (nao offset) pra datasets grandes
- Connection pooling (Supabase ja faz)
- Evitar N+1 queries (usar JOIN ou batch)
- Cache de queries frequentes e estaticas
Supabase RLS (obrigatorio)
-- Usuarios so veem seus proprios dados
CREATE POLICY "users_own_data" ON profiles
FOR ALL USING (auth.uid() = user_id);
Indices essenciais
-- Sempre criar indices pra foreign keys
CREATE INDEX idx_orders_user_id ON orders(user_id);
-- Indice composto pra queries frequentes
CREATE INDEX idx_orders_status_date ON orders(status, created_at DESC);
Migracoes seguras
- Sempre testar migracoes em staging antes de prod
- Nunca DROP TABLE sem backup
- Adicionar colunas como nullable primeiro, depois preencher, depois NOT NULL
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.