Neura Market
    Neura Market
    /DeepSeek
    Marketplace
    Directories
    Resources
    DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeekCoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    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
    Architecture

    Claude Coder Microservices Communication Rules

    System rules for designing inter-service communication in microservices architectures with DeepSeek Coder, covering sync/async patterns, error handling, and resilience.

    N
    Neura Market
    Content

    DeepSeek V3 Multilingual Content Generation Rules

    System rules for generating content in multiple languages with DeepSeek V3, covering translation quality, cultural adaptation, locale-specific formatting, and quality assurance.

    N
    Neura Market
    Development

    DeepSeek R1 Code Refactoring Safety Rules

    System rules for safe code refactoring with DeepSeek R1, requiring test coverage verification, incremental changes, and behavior preservation checks.

    N
    Neura Market
    Documentation

    DeepSeek V3 Technical Documentation Writer Rules

    System rules for using DeepSeek V3 to generate clear, maintainable technical documentation including API docs, architecture docs, and onboarding guides.

    N
    Neura Market
    DevOps

    DeepSeek V3 DevOps and Infrastructure Rules

    System rules for using DeepSeek V3 to generate infrastructure code, CI/CD pipelines, and operational runbooks with security and reliability best practices.

    N
    Neura Market
    Writing

    DeepSeek R1 Academic Writing Assistant Rules

    System rules for configuring DeepSeek R1 as an academic writing assistant that maintains scholarly tone, proper citations, and disciplinary conventions.

    N
    Neura Market

    Neura weekly digest

    Stay up to date

    The week's most-read AI news, trending AI tools and new automation workflows, in one email. At most once a week. Free, and you can unsubscribe in one click.

    Neura Market LogoNeura Market

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

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Games
    • Blog
    • Videos
    • Guides
    • Courses
    • Community

    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.

    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
    Claude Coder Database Query Optimization Rules