Complete AI Training
Sign inGet my AI kit

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI agent for database administrators

Index Usage and Redundancy Review Agent

Fewer needless indexes with every drop tested against real queries

Index Usage and Redundancy Review Agent: what goes in, what the agent does and what you get

What it does

Unused and duplicate indexes slow writes and waste space, but dropping the wrong one hurts reads. This agent reads index usage statistics over a full business cycle and finds indexes that are unused, duplicated or overlapping with another. For each one, it tests dropping it in a copy of the database against your top queries. If any query slows beyond a set limit, it reverts the test and keeps the index. The administrator approves each drop for production. Edge case: an index shows no use all month, but a quarter-end report depends on it, so the agent checks usage over a full quarter before suggesting a drop.

How it works

Follow the arrows from top to bottom. The orange dashed arrow is the loop: when a check fails, the agent goes back and tries again.

Start and resultWhat it doesA check on its own workWaits for your OKGoes back and retries
Yes, continueApprovedYes, continueNoNo 1 STARTS WHEN Quarterly index review 2 USES A TOOL Read index usage over the full business cycle 3 DOES Find unused, duplicate and overlapping indexes 4 DOES Rank by write cost and space 5 USES A TOOL Drop each candidate in the test copy and run the topqueries 6 CHECKS THE RESULT Did every top query stay within the slowdown limit? If not: revert the test and keep the index. Back to step5. 7 DOES Estimate space and write savings for passingcandidates 8 YOU APPROVE Administrator approves each production drop 9 USES A TOOL Drop in production in a window and record thedefinition for rebuild 10 CHECKS THE RESULT Are query times normal a week later? If not: recreate the index from the saved definition.Back to step 9. 11 RESULT Index review report
Read the steps as a list
  1. Quarterly index review
  2. Read index usage over the full business cycle
  3. Find unused, duplicate and overlapping indexes
  4. Rank by write cost and space
  5. Drop each candidate in the test copy and run the top queries
  6. Did every top query stay within the slowdown limit?If not: revert the test and keep the index. Back to step 5.
  7. Estimate space and write savings for passing candidates
  8. Administrator approves each production dropThe agent waits here for your OK.
  9. Drop in production in a window and record the definition for rebuild
  10. Are query times normal a week later?If not: recreate the index from the saved definition. Back to step 9.
  11. Index review report

How it decides

An index is a drop candidate when it shows no use over the full cycle, or when another index covers the same columns. A drop is kept if no top query slows.

  • Use a full business cycle of statistics
  • Test every drop against the top queries
  • Keep a saved definition of every dropped index
  • Revert when any top query slows beyond 10%

Make it yours

Every agent is a starting point. You choose these settings for your own situation.

  • Statistics period (default: 90 days)
  • Slowdown limit (default: 10%)
  • Top query list
  • Tables in scope

What keeps you in control

It always asks you first

  • Administrator approves each production drop

Hard limits

  • Never drops an index without approval
  • Never tests in production

It stops when

  • Done: approved drops are applied and stable
  • Stop: usage statistics were reset recently

Set it up

We guide you through the set-up, step by step

Members get the full set-up guide for this agent. No technical skills needed: you copy, paste and upload.

10 minto set it up in your AI
5 AIsChatGPT, Claude, Copilot, Gemini, Grok
  • One set of instructions to paste into your AI, with the clicks for ChatGPT, Claude, Microsoft 365 Copilot, Gemini and Grok
  • The agent then walks you through connecting your own data, one source at a time
  • A downloadable copy with the flow chart, the rules and the full guide
Get access to this agent

An example run

What happensThe review found 14 unused indexes and 3 duplicates on an orders table. Dropping one index in the test copy slowed the quarter-end report by 340%, so it was reverted. The other 16 passed. The administrator approved 15 drops, which saved 18 GB. A week later query times were normal.

More agents for database administrators