Claude Coder Database Query Optimization Rules — Free…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    DeepSeekRulesClaude Coder Database Query Optimization Rules
    Back to Rules
    Database

    Claude Coder Database Query Optimization Rules

    Neura Market April 24, 2026
    0 copies 0 downloads

    System rules for DeepSeek Coder to generate optimized database queries, with requirements for EXPLAIN analysis, indexing recommendations, and performance targets.

    Rule Content
    # Claude Coder Database Query Optimization Rules
    
    ## Query Generation Standards
    1. ALWAYS use parameterized queries — NEVER string concatenation
    2. SELECT only needed columns — no SELECT * in production code
    3. Use CTEs for readability; convert to subqueries only if measurably faster
    4. JOIN order: smallest table first, filtered table first
    5. LIMIT results when the full result set isn't needed
    6. Use UNION ALL instead of UNION unless deduplication is required
    
    ## Index Recommendations
    - For every query you write, suggest appropriate indexes
    - Composite index column order: equality conditions first, then range, then sort
    - Consider partial indexes for queries with constant WHERE conditions
    - Use covering indexes (INCLUDE columns) for frequently accessed columns
    - GIN indexes for JSONB, array, and full-text search columns
    
    ## Performance Requirements
    - Queries returning < 100 rows: target < 10ms
    - Queries returning 100-10K rows: target < 100ms
    - Analytical queries: target < 5s
    - If a query exceeds targets, provide EXPLAIN ANALYZE and optimization steps
    
    ## Anti-Patterns (NEVER DO)
    - N+1 queries — always use JOINs or subqueries
    - Unbounded queries without LIMIT
    - Functions on indexed columns in WHERE clauses (kills index usage)
    - LIKE '%prefix' searches (use trigram indexes or full-text search)
    - Recursive CTEs without termination conditions
    - Correlated subqueries when JOINs suffice
    
    ## Migration Safety
    - All migrations must be reversible (provide UP and DOWN)
    - No locking operations on large tables during peak hours
    - Use concurrent index creation (CREATE INDEX CONCURRENTLY)
    - Test migrations on production-size dataset before applying

    Tags

    databasesqloptimizationindexingperformance

    Comments

    More Rules

    View all

    Zenna.Github.Io DeepSeek Rules

    Z
    zenna

    Study With Ai DeepSeek Rules

    R
    rytkmt

    Hack The World DeepSeek Rules

    M
    mahmudulhaquequdrati

    Dify DeepSeek Rules

    D
    duongthai187

    Acacia Garden AI Worldbuilding Codex DeepSeek Rules

    B
    brandonmarkgaia-hub

    Paper Digest DeepSeek Rules

    M
    MarkLee131

    Stay up to date

    Get the latest DeepSeek prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for DeepSeek and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this DeepSeek resource

    • Automate YouTube Video Optimization with Google Sheets and DeepSeek AIn8n · $9.99 · Related topic
    • Automate Flight Searches and Recommendations with DeepSeek AI and Google Flightsn8n · $4.99 · Related topic
    • WordPress Content Assistant: Article Recommendations & Q&A with Mistral AIn8n · $24.99 · Related topic
    • Building a RAG Chatbot for Movie Recommendations with Qdrant and OpenAIn8n · $14.99 · Related topic
    Browse all workflows