Database Index

You might say

Queries were instant with a few rows, but with tens of thousands of orders the page spins—AI says to add an index. What does that mean?

An ordered lookup directory on frequently queried columns so the database avoids scanning every rowOnce an orders table reaches 500,000 rows, filtering by user_id slows down until an index lets the database jump straight to matching rows. Indexes are not free: every extra index must be updated on inserts and edits, so indexing every column slows down writes and uses extra storage.
Know first
DB Index

You can say this to an AI Agent

Ready to paste into Cursor, Claude Code, or Codex
Structured AI Agent prompt

The endpoint that fetches a user's recent orders slowed down as data grew. Run `EXPLAIN ANALYZE` first to check if it is doing a full table scan, then add a migration with a database index matching the actual `WHERE` and `ORDER BY` columns without indexing unused fields. Run `EXPLAIN ANALYZE` again to compare scanned rows and latency.

Want your Agent to translate plain-language UI ideas automatically?Install free VibeHub Skill →
Oil UI Pro. Push AI’s design skills to the limit. Usability, existing projects and stricter review.
Further reading