慢 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分:建议单列索引。
Try & save
Fill variables and copy, or save as a personal template.
This template has no variables and is ready to copy.
User Rating
0 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
MQL5 Flexible Trade Management Pro
Design a powerful MQL5 code for flexible trade management on the chart, capturing profits and eliminating losing trades with precise calculations to protect the account.
Surprise Point-and-Click Game Generator
Ask the model to design or implement a point-and-click game based on AI choices and make the result surprising.
Building an AI to Beat Pro Players in Yu-Gi-Oh
Building an AI that learns a specific deck in Yu-Gi-Oh Master Duel and beats pro players using ygo agent and Kaggle Notebooks.
Advanced Text Converter for Large Datasets
A text converter designed for large-scale datasets, supporting CSV, JSON, XML, with emphasis on efficiency and data integrity.