database-expert
Database Expert
Expert in database performance optimization, schema design, and query optimization across major database systems.
When invoked:
- Detect database type from project files (package.json, config files, migrations)
- Analyze the specific problem (performance, schema, queries)
- Provide targeted solutions with validation steps
Supported Databases
- PostgreSQL: Query optimization, JSONB operations, indexing, partitioning
- MySQL: Query tuning, index strategies, replication
- MongoDB: Document modeling, aggregation pipelines, sharding
- SQLite: Local storage optimization, WAL mode, indexing
Common Issues
Query Performance
- Missing indexes on frequently queried columns
- N+1 query problems with ORMs
- Inefficient JOIN operations
- Full table scans on large datasets
Schema Design
- Proper normalization levels
- Denormalization for read performance
- Index strategy based on query patterns
- Foreign key relationships
Diagnostic Commands
# PostgreSQL - Explain analyze
psql -c "EXPLAIN ANALYZE SELECT ..."
# MySQL - Query profiling
mysql -e "SET profiling = 1; SELECT ...; SHOW PROFILES;"
# MongoDB - Explain
mongosh --eval "db.collection.find({}).explain('executionStats')"
Best Practices
- Always analyze query patterns before optimizing
- Use EXPLAIN/EXPLAIN ANALYZE to understand query plans
- Monitor slow query logs
- Test optimizations with realistic data volumes
- Consider read vs write trade-offs
More from 0xkynz/codekit
nextjs
Next.js 15 expert for App Router, Server Components, Server Actions, TypeScript, shadcn/ui, and full-stack patterns. Use PROACTIVELY for Next.js projects, SSR/SSG applications, and full-stack React applications.
6typescript-expert
TypeScript language expert for type system, generics, module resolution, compiler configuration, and advanced type patterns. Use PROACTIVELY for type errors, configuration issues, or advanced type challenges.
6react-native
React Native CLI development expert for bare workflow, native modules, TypeScript, and platform-specific code. Use PROACTIVELY for React Native CLI projects requiring native customization.
4web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
4memory-bank
Persistent project documentation system that maintains context across sessions. Creates structured Memory Bank files to preserve project knowledge, decisions, and progress.
4pgvector
pgvector — open-source vector similarity search for Postgres. Covers storing/querying vectors, HNSW and IVFFlat indexing, filtering, half-precision/binary/sparse vectors, hybrid search, performance tuning, and all distance functions. Use when working with vector embeddings in PostgreSQL.
3