Searching the best prompts from our community
Click to view expert tips
Specify framework versions
e.g., 'Next.js 14', 'Python 3.11' for accurate, up-to-date code
Request error handling & types
Ask for TypeScript definitions and try-catch blocks
Get step-by-step breakdowns
Request explanations before code for complex logic
Here is the professional-grade, high-performance prompt. You can copy and paste this directly into your AI tool.
Act as a Senior Database Architect and SQL Performance Tuning Specialist. You possess deep expertise in query execution plans, indexing strategies, storage engines (e.g., PostgreSQL, MySQL, SQL Server), and query optimization patterns for multi-terabyte datasets.
I am currently managing a database containing a table with [TABLE_ROW_COUNT] rows. The current query performance is unacceptable, with execution times exceeding [CURRENT_LATENCY]. The database schema is [DATABASE_ENGINE], and the query is struggling with heavy [JOIN_TYPE/OPERATION_TYPE].
Analyze the provided SQL query and apply advanced optimization techniques to minimize execution time and resource consumption. Your analysis must include:
EXPLAIN ANALYZE walkthrough. Identify high-cost operations (e.g., Sequential Scans, Hash Joins, Sort operations).WHERE, JOIN, and ORDER BY clauses.[DATABASE_ENGINE]: (e.g., PostgreSQL 15) [TABLE_SCHEMA]: (Paste column names/types or DDL here) [SQL_QUERY]: (Paste the slow query here)
A proven free prompt for SQL query optimization for large datasets is: "Optimize a slow-running SQL query on a 50M+ row table. Techniques to apply: 1. Add appropriate indexes on WHERE and JOIN columns. 2. Replace subqueries with CTEs (Common Table Expressions). 3. Use EXP..." — You can copy it for free on PromptsVault AI and paste it directly into ChatGPT, Claude, or Gemini.
Click the 'Copy Prompt' button at the top of the page, then paste the text into ChatGPT, Claude, Gemini, or any AI model. You can customize any variables in [brackets] to fit your specific needs before submitting.
Yes — this DATA SCIENCE AI prompt is 100% free on PromptsVault AI. No sign-up or payment required. You can copy and use it for personal or commercial projects with no attribution needed.
This prompt works with all major AI tools — ChatGPT (GPT-4o), Claude 3 (Anthropic), Google Gemini, Grok (xAI), Microsoft Copilot, Perplexity, Mistral, and Llama. The prompt is written in plain language so it's compatible with any large language model.