Geminicodeadvanced

Optimise a Slow SQL Query

Act as a database performance engineer. This [MySQL / PostgreSQL] query is slow: [PASTE QUERY]. Table sizes: [ROW COUNTS]. Existing indexes: [INDEXES]. EXPLAIN output: [PASTE EXPLAIN]. Explain why it is slow in plain words, suggest the best indexes, rewrite the query if needed, and estimate the improvement. List trade-offs of each change and how to verify the speed-up safely on a copy of the data.

Updated Nov 22, 2026 · Copied 0 times

Tip

Always share the EXPLAIN output so advice is based on facts.

Advertisement

More prompts

ChatGPT code

Debug an Error Message Step by Step

You are a senior developer helping me debug. Language and framework: [LANGUAGE / FRAMEWORK]. Error message: [PASTE ERROR]. Relevant code: […

Claude code

Explain Code Line by Line

Act as a patient programming mentor. Explain the code below to a [BEGINNER / INTERMEDIATE] developer. Language: [LANGUAGE]. Code: [PASTE CO…

ChatGPT code

SQL Query from Plain English

Act as a database expert. Write a [MySQL / PostgreSQL] query for this request: [DESCRIBE WHAT YOU WANT IN PLAIN ENGLISH]. Tables and column…

ChatGPT code

PHP MySQL CRUD Helper with PDO

You are a PHP 8 developer. Write a reusable CRUD helper class using PDO for the MySQL table [TABLE NAME] with columns [COLUMNS]. Include me…