Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Epics
Fix N+1 queries on kanban board page
Edit
Fix N+1 queries on kanban board page
Cancel
Save
Title
*
Project
*
Choose an option
alpha
tinker
Create new project
Description
The kanban board page has N+1 query issues that cause performance degradation: **Primary Issue - Comments not eager loaded:** - File: app/views/tickets/_kanban_card.html.haml:57-61 - The view accesses `ticket.comments.any?` and `ticket.comments.count` for each ticket card - Comments are NOT included in the controller's eager loading **Secondary Issue - Subtasks filtered in view:** - File: app/views/tickets/_kanban_card.html.haml:80-86 - Even though subtasks are included, the view makes filtered queries: - `ticket.subtasks.where(status: 'done').count` - `ticket.subtasks.where.not(status: 'cancelled').count` **Current state in DashboardController#kanban:** - Line 22: `includes(:project, :assigned_agent, :subtasks)` - Missing `comments` - Line 34-35: `includes(:assigned_agent, :subtasks)` - Missing `comments` and `:project` **Tasks:** 1. Add `comments` to all ticket eager loading in the kanban action 2. Optionally add counter_cache columns for subtasks to avoid filtered queries in view 3. Verify the fix by loading the kanban page with a sufficient number of tickets **Files to modify:** - app/controllers/dashboard_controller.rb (kanban action)
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel