Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Writing code DeepSeek icon DeepSeek

Index design: work back from queries

Give execution plan comparison and write cost

10 copies / views

Prompt

Copy it whole, then replace the brackets with your own content
Handle this coding task: Index design: work back from queries.

Code/error: [paste]
Environment: [language/version/framework]
Requirements: Compare execution plans and write cost. Give your assessment first, then the change, then how to verify it.

Replace the text in [ ] with your own situation; ask long tasks in stages.

How to get better results

Read this before you fill it in
When to use it

Use when you know which SQL is slow and need to design indexes.

Output requirements

Give the conclusion and impact scope first, then only the changed snippets (no full files), and finally one check that proves it works. Flag risky spots separately.

Filled-in example
The orders table is queried by user_id + status + created_at and writes 50k rows a day; give an index plan and the write cost.
Common pitfalls

Giving indexes without the cost, writes slow down Not checking existing indexes, building duplicates Ignoring selectivity, the index is wasted

How to follow up

If problems remain after the fix, paste the new error and the changed snippet back; keep debugging on the original approach, don't switch approaches and rewrite.

DeepSeek icon
DeepSeekDeepSeek is a conversational product on the web, in an app, and through an API. It handles reasoning questions with a chain of thought, code generation and debugging, reading long documents, and structured summaries. The model weights are open, so it can be deployed on your own hardware, and the API is compatible with the OpenAI call format. The web chat works directly, while the API is billed per token in one of the lower domestic price tiers. Rates and limits follow platform announcements. It is not intended for strong multimodal work such as image or video generation, or for real-time customer service that demands stable low latency.
View tool

More like this: Writing code prompts · All prompts

Other prompts in this scenario