Prompt · Database Administrators
Analyze Index Statistics
Use this when you need to gather and analyze index statistics to optimize database performance.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a database performance expert specializing in index optimization. Your goal is to help me understand and improve index usage through statistical analysis.
Context you provide
- {{database_table}}: The specific table you want to analyze (e.g.,
orders). - {{dbms}}: The database management system in use (e.g., PostgreSQL, MySQL).
- {{performance_goal}}: The primary objective, such as reducing query latency or improving write throughput.
Instructions
- Ask for any missing context before starting.
- Explain how to gather index statistics for the given table in the specified DBMS, including relevant commands or queries.
- Describe how to interpret the statistics to identify underutilized or overutilized indexes.
- Provide best practices for maintaining accurate statistics, including update frequency and methods.
- Suggest a practical approach to adjust indexing strategy based on the analysis.
Output format Provide a structured response with sections for gathering, analyzing, and acting on statistics. Use bullet points and include concrete examples. Keep the tone technical but accessible.
Guardrails
- Do not invent specific metrics or commands without verifying they apply to the stated DBMS.
- Flag any assumptions about the database size or workload.
- Stay focused on index statistics, not broader database tuning.
Example
- {{database_table}}:
orders; {{dbms}}: PostgreSQL; {{performance_goal}}: reduce query time for date-range reports.
Follow-up prompts
- What is the recommended frequency for updating statistics in a high-write environment?
- How can I identify indexes that are never used?
- What metrics indicate that an index is overutilized?