Archived tasks being grouped in filter dropdowns
Filter dropdowns load faster and automatically separate active tasks from archived ones, dropping heavy database queries in favor of a dedicated registry.
Fetching tasks for filter dropdowns relied on a database query that consumed over 7% of database runtime and sometimes produced duplicate entries when trigger sources changed.
Now, filter dropdowns are backed by a dedicated registry synced to a high-speed cache. Active tasks are separated from archived ones that are no longer present in the latest deployment.
This reduces database load while providing a cleaner interface for filtering logs and runs in the dashboard. Trigger operations also route read requests to a replica, further relieving the primary database.
View Original GitHub Description
Replace the expensive DISTINCT query for task filter dropdowns with a dedicated TaskIdentifier registry table backed by Redis. Environments migrate automatically on their next deploy, with a transparent fallback to the legacy query for unmigrated environments. Also fixes duplicate dropdown entries when a task changes trigger source, and adds active/archived grouping for removed tasks. Moves BackgroundWorkerTask reads in the trigger hot path to the read replica.