Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 2, 2025

This PR addresses slow task output loading performance when there are many tasks with long outputs by adding a missing database index on the task_id column in the task__output table.

Problem

Users reported significant slowness when displaying task outputs, particularly in environments with many tasks containing long output logs. The root cause was identified as missing database indexing on the task_id column, which is heavily used in queries that filter task outputs by task ID.

Solution

Added a new database migration (v2.16.4) that creates an index on the task_id column:

create index task__output_task_id on task__output (task_id);

This index will significantly improve query performance for the following operations:

  • GetTaskOutputs() - retrieving all outputs for a specific task
  • GetTaskStageOutputs() - retrieving outputs for specific task stages
  • Any other queries filtering task outputs by task ID

Testing

  • ✅ All existing tests pass
  • ✅ Migration executes successfully during setup
  • ✅ Application builds and starts without errors
  • ✅ API endpoints function correctly
  • ✅ Web interface loads properly

The migration follows the established pattern used by other database migrations in the project and is compatible with all supported database backends (MySQL, PostgreSQL, SQLite, BoltDB).

Fixes #3213.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Problem: Loading task output is slow. Add database index on task_id column in task__output table for performance improvement Sep 2, 2025
@Copilot Copilot AI requested a review from fiftin September 2, 2025 20:47
Copilot finished work on behalf of fiftin September 2, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem: Loading task output is slow.
2 participants