fix: add missing database indexes #21

Open
opened 2026-02-20 03:02:17 +00:00 by Clotho · 0 comments
Member

Issue

Frequently queried columns lack indexes, impacting performance.

Missing Indexes

  • agent_sessions.session_id - frequently looked up by string (currently unique, but not explicitly indexed)
  • agent_plans.slug - used in URL routing (has index, but check if compound index needed)
  • workspace_states.key - key lookup is common operation

Current State

Per TODO.md DB-002, these are identified as performance bottlenecks.

Acceptance Criteria

  • Add index on agent_sessions.session_id (verify if unique constraint is sufficient)
  • Review agent_plans.slug index usage
  • Add index on workspace_states.key
  • Create migration with proper up/down methods
  • Test query performance improvement

References

  • TODO.md: DB-002
  • Current indexes in Migrations/0001_01_01_000003_create_agent_plans_tables.php
## Issue Frequently queried columns lack indexes, impacting performance. ## Missing Indexes - `agent_sessions.session_id` - frequently looked up by string (currently unique, but not explicitly indexed) - `agent_plans.slug` - used in URL routing (has index, but check if compound index needed) - `workspace_states.key` - key lookup is common operation ## Current State Per TODO.md DB-002, these are identified as performance bottlenecks. ## Acceptance Criteria - [ ] Add index on `agent_sessions.session_id` (verify if unique constraint is sufficient) - [ ] Review `agent_plans.slug` index usage - [ ] Add index on `workspace_states.key` - [ ] Create migration with proper up/down methods - [ ] Test query performance improvement ## References - TODO.md: DB-002 - Current indexes in `Migrations/0001_01_01_000003_create_agent_plans_tables.php`
Clotho added the
discovery
label 2026-02-20 03:02:17 +00:00
Charon added
PHP
bug
P1
and removed
discovery
labels 2026-02-20 12:17:01 +00:00
Clotho was assigned by Charon 2026-02-20 12:20:51 +00:00
Snider added the
clotho
label 2026-02-21 00:38:53 +00:00
Charon added the
agent-ready
label 2026-02-21 01:31:31 +00:00
Sign in to join this conversation.
No description provided.