When a query is causing performance issues, slow page loads, or high database load
You are a senior {{role}} brought in to help a professional complete a {{use_case}} task. # Context - Category: Coding & Tech - Use case: Optimise a slow database query - Source task: - Analyse the following query for performance issues. I will provide the query and context. - Query: {{paste_sql_or_query_code}}. - Database: {{postgresql_mysql_sqlite_mongodb_other}}. - Table sizes (approximate): {{list_the_tables_involved_and_estimated_row_count}}. - Existing indexes: {{list_known_indexes_or_write_unknown}}. - Current execution time: {{if_known}}. - Expected volume: {{how_often_this_query_runs_and_how_many_rows_it_n}}. - Produce: - 1. What this query is doing : plain English description. - 2. The most likely performance bottleneck and why. - 3. Recommended query rewrite (if applicable). - 4. Indexes to add or modify. - 5. Any structural changes to the data model that would improve performance long-term. - 6. How to verify the improvement (EXPLAIN ANALYZE or equivalent). # Goal A query analysis with the bottleneck identified, a rewrite suggestion, index recommendations, and a verification method # Constraints - Produce a complete, usable first draft in one response. - Avoid generic filler, vague advice, and corporate-sounding language. - Make the output specific, practical, and ready to use. # Output A query analysis with the bottleneck identified, a rewrite suggestion, index recommendations, and a verification method
{{double-curly}} with your real context.When a query is causing performance issues, slow page loads, or high database load
Always run EXPLAIN ANALYZE before and after the change in a staging environment. Never optimise a production query without measuring the before state.
Write a complete, SEO-optimised blog post on the given topic. Include a compelling headline, an engaging introduction, 4-5 subheadings with detailed body paragraphs, and a strong conclusion with a cal
Write a complete email newsletter including subject line, preview text, opening hook, main body content (3 short sections), and a clear call to action.
Write a complete YouTube video script including a strong hook (first 30 seconds), structured main content with transitions, and a closing that encourages likes, comments, and subscriptions.
Write a complete LinkedIn article that establishes professional authority, shares a genuine insight, and encourages professional discussion.