Software Development · Media & Entertainment

Optimise a slow SQL query for Media & Entertainment

Use this when a page or report is slow because of a database query. Written for a media studio publishing video and podcasts.

Your prompt is ready 4 brackets to fill
You are an expert in this kind of work, and you know the Media & Entertainment sector from the inside.

## Your task
This query is slow on a [DATABASE] database at a media studio publishing video and podcasts. Table sizes: [ROW COUNTS]. Explain why it is slow, rewrite it, suggest indexes (with CREATE INDEX statements) and tell me what to look for in EXPLAIN to confirm the improvement.

## About my situation
- Who this is for: audiences, advertisers and creators
- What we must respect: copyright, licensing and release schedules
- How we measure success: audience retention and watch time

## What matters in Media & Entertainment
- Rules and standards that usually apply: copyright and licensing for music and footage; the limits of fair use; platform policies (YouTube, Spotify, Instagram); disclosure of sponsored content; defamation and privacy law.
- Common risks to plan for: copyright strikes; algorithm changes; creator burnout; missed release dates; brand-safety problems.
- Tools commonly used: YouTube Studio; Spotify for Podcasters; Premiere Pro or DaVinci Resolve; Canva; social schedulers.
- Words people in this field use: hook; thumbnail; CTR; retention curve; episode; sponsor read; licensing; release schedule.
- Rules differ by country. If I have not said where I work, ask me, and do not present one country's law as if it applied everywhere.

## What I will give you
Query:
[PASTE QUERY]
Schema:
[PASTE SCHEMA]

## How to work through it
1. Read the query and schema and explain how the database will execute it.
2. Point out what makes it slow (full scans, bad joins, functions on indexed columns, N+1 patterns).
3. Rewrite the query.
4. Suggest indexes with CREATE INDEX statements and their trade-offs.
5. Explain what to look for in EXPLAIN before and after.

## What to deliver
- Why it is slow
- The rewritten query
- Index statements
- EXPLAIN checklist
- Expected improvement

## Rules
- Make every point specific to my situation and my industry; replace generic advice with detail that fits.
- Use plain language, short sentences, and tables where they make the answer easier to scan.
- Use only the facts I give you. Do not invent figures, laws, sources or quotes. Mark anything you had to assume with "Assumption:".
- If something important is missing, ask me up to 3 short questions before you start.

## Before you answer
Check your draft against this list and fix anything that fails:
- The code works as written: no invented libraries, functions or APIs, and versions are named where they matter.
- It is written for a media studio publishing video and podcasts; nothing in it would read the same for any other business.
- Nothing in it breaks copyright, licensing and release schedules.
- Every item under "What to deliver" is included.
Open in ChatGPT Claude Perplexity

How to use this prompt

  1. Copy the prompt. Press Copy prompt and the full text goes to your clipboard.
  2. Fill the brackets. Use the form above, or replace [DATABASE], [ROW COUNTS], [PASTE QUERY], [PASTE SCHEMA] with your own details.
  3. Paste and send. Paste it into ChatGPT, Claude and DeepSeek and send. Ask follow-up questions to refine the answer.

Why use this Optimise a slow SQL query prompt?

This optimise a slow sql query prompt is written for a media studio publishing video and podcasts. It tells the assistant who the answer is for (audiences, advertisers and creators) and the limits it must respect: copyright, licensing and release schedules. That context is what turns a generic reply into one a Media & Entertainment team can use straight away.

Most people type a single line and get a generic answer back. This prompt gives the assistant the role, the context and the structure it needs, so the first answer is already close to what you would hand to your team. Because it is written for Media & Entertainment, it keeps the focus on what that industry measures: audience retention and watch time.

How to get the best answer

  1. Be specific in the brackets: real names, numbers and dates give a far better answer than placeholders.
  2. Paste real material: where the prompt asks for notes, data or text, paste the actual content rather than a summary.
  3. Refine in the same chat: ask "make it shorter", "turn it into a table" or "add more detail on step 2".
  4. Check the result: review it against what you know about audience retention and watch time before you share it.

Other industries

Same prompt for other industries

The same optimise a slow sql query prompt, rewritten for each industry.

FAQ

Frequently asked questions

Which AI assistant works best with this Optimise a slow SQL query prompt?

It works in any chat assistant. It suits ChatGPT, Claude and DeepSeek best. Paste it in, send it, and ask follow-up questions in the same chat.

What do I need to replace before sending it?

Replace the 4 highlighted brackets – [DATABASE], [ROW COUNTS], [PASTE QUERY], [PASTE SCHEMA] – with your own details. The more specific you are, the better the answer.

Is this prompt only for Media & Entertainment?

This version is written for a media studio publishing video and podcasts. The same prompt is also available for 15 other industries, listed on this page.

Is it free to use?

Yes. Copy it as often as you like and use it in your own work. No sign-up is needed.

Can I trust the answer?

Treat it as a strong first draft. Check facts and figures yourself, especially anything with legal, financial, medical or safety consequences.

Keep exploring

Browse more Media & Entertainment prompts