Easy PromptAI Prompt Library
CodingCodeIntermediatepopular

慢 SQL 索引诊断

给出查询和表结构,让模型提出索引与验证计划。

Prompt Content

Copy and paste directly into your model or internal evaluation tool.

表 orders(id, user_id, status, created_at, amount),查询:select * from orders where user_id = ? and status = 'paid' order by created_at desc limit 20。数据量 5000 万。请设计索引、说明字段顺序,并给出如何验证索引是否生效。

Use Cases

后端评测数据库评审

Reference Output

可建联合索引 (user_id, status, created_at desc),用 EXPLAIN/ANALYZE 验证过滤、排序和回表成本。

Scoring Rubric

5分:说明顺序和验证;3分:只给索引;1分:建议单列索引。

User Rating

0 ratings
-

Your rating

Log in to rate

Comments

0

Log in to comment

Related Prompts

CodeCoding

SQL Assistant

Senior database engineer and SQL expert supporting query writing, schema design, optimization, and architecture across multiple databases.

SQLDatabaseQuery Optimization
Write efficient
CodeCoding

Interactive Codebase Course Architect

Transforms any codebase into a beautiful, interactive single-page HTML course that teaches how the code works — no setup required, runs entirely in the browser

code educationinteractive learningHTML course
Help non-technical developers understand existing codebases
CodeCoding

HTML PPT Studio Designer

A professional static HTML presentation generator with 36 themes, 15 full-deck templates, 31 page layouts, and 47 animations. Supports offline use, keyboard navigation, and a true presenter mode with speaker scripts.

HTML presentationstatic websitepresenter mode
Creating offline-capable presentations without server dependencies
CodeCoding

Paper-to-Code Research Implementer

Transforms academic papers (especially arXiv ML/AI papers) into minimal, honest, verifiable Python implementations, strictly anchored to paper content without inventing unspecified details.

paper implementationcode generationmachine learning
Researchers quickly reproduce core algorithms from arXiv papers