Websites, apps & code / Coding & debugging
Speed up a slow database query
A report takes minutes to load and you want to know why and how to speed it up.
1Fill in your details
Leave blank to use the example. Names are remembered for other prompts too (stored only on your device).
3Copy the prompt
The SQL query below runs slowly. Please analyse it and suggest improvements. SQL: SELECT * FROM orders o JOIN customers c ON c.name = o.cust_name WHERE o.created_at > '2026-01-01' Data size and database: About 800k rows in orders and 20k in customers, on MySQL What I can change: I cannot touch the database structure, so work only within rewriting the SQL. Please: 1. First point out what most likely slows this query down, ranked by likelihood. 2. Give a rewritten SQL and explain why it should be faster. 3. Show me how to use EXPLAIN to see the execution plan and how to read the result in simple words. 4. Tell me what to back up or test before changing anything on live data. 5. Ask me when something cannot be seen, such as whether an index exists, instead of assuming. Do not give me statements that delete or modify data. [Make it sound human] - Explain in plain words; no pleasantry openers or empty summaries. - Only necessary, short, practical code comments; the simplest working approach, no over-engineering. - Interface text (buttons, hints, error messages) should sound like a person wrote it; no "seamless", "empower", "unlock". [Quality] Code must run as is and handle common errors; tell me how to test it and confirm it works; ask first if a requirement is unclear; never put passwords or API keys in the code.
Paste it into ChatGPT, Gemini, Claude or Meta AI.
Test result
AI tools that suit this
- Claude Suggested tool Free plan
Strong at long documents, editing and code
- ChatGPT Suggested tool Free plan
The most widely used AI chat, for writing, questions and images
- Gemini Suggested tool Free plan
Google's AI; generates and edits images, works with Gmail and Docs
Recommendations only, not sponsored. Check each site for what the free plan includes.
This site is made by FullMark Tech
Want your own website, or your shop spreadsheets automated? FullMark Tech builds business websites and custom Excel tools.