cuddly-jelly-27016
04/23/2025, 12:57 PMworkflows.name. However, there is an index workflow_project_domain_name_idx" btree (project, domain, name). The performence for above query could be improved significantlyby filtering project and domain on the workflows table instead of the executions table:
SELECT "executions"."id",
"executions"."created_at",
"executions"."updated_at",
"executions"."deleted_at",
"executions"."execution_project",
"executions"."execution_domain",
"executions"."execution_name",
"executions"."launch_plan_id",
"executions"."workflow_id",
"executions"."task_id",
"executions"."phase",
"executions"."closure",
"executions"."spec",
"executions"."started_at",
"executions"."execution_created_at",
"executions"."execution_updated_at",
"executions"."duration",
"executions"."abort_cause",
"executions"."mode",
"executions"."source_execution_id",
"executions"."parent_node_execution_id",
"executions"."cluster",
"executions"."inputs_uri",
"executions"."user_inputs_uri",
"executions"."error_kind",
"executions"."error_code",
"executions"."user",
"executions"."state",
"executions"."launch_entity"
FROM "executions"
INNER JOIN workflows ON executions.workflow_id = workflows.id
WHERE workflows.project = $1
AND workflows.domain = $2
AND workflows.name = $3
AND executions.state = $4
ORDER BY created_at DESC
LIMIT 1
### Expected behavior
I'd expect the UI page to be much faster and the queries to leverage existing indexes (or otherwise an index over workflows.name to be created).
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/05/2025, 6:10 PM