You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Get Execution currently uses gorm First which imposes an order by on all executions by id. Even though id is indexed this ordering is not necessary and adds significantly to the query plan
# EXPLAIN ANALYZE SELECT * FROM "executions" WHERE "executions"."deleted_at" IS NULL AND (("executions"."execution_project" = 'flytetester') AND ("executions"."execution_domain" = 'development') AND ("executions"."execution_name" = 'aiwlr18um4')) ORDER BY "executions"."id" ASC LIMIT 1;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=5.48..5.49 rows=1 width=986) (actual time=0.105..0.136 rows=1 loops=1)
-> Sort (cost=5.48..5.49 rows=1 width=986) (actual time=0.091..0.107 rows=1 loops=1)
Sort Key: id
Sort Method: quicksort Memory: 26kB
-> Seq Scan on executions (cost=0.00..5.47 rows=1 width=986) (actual time=0.032..0.053 rows=1 loops=1)
Filter: ((deleted_at IS NULL) AND (execution_project = 'flytetester'::text) AND (execution_domain = 'development'::text) AND (execution_name = 'aiwlr18um4'::text))
Rows Removed by Filter: 29
(ignore the inner seq scan, i think that's an artifact of using a small, local test db).
Furthermore, for relational workflows (e.g. relaunch) we look up the parent workflow on every get just to retrieve the full parent execution identifier. This can simply be captured once, at child/reference workflow execution launch time.
Expected behavior
Gets on workflow executions should be performant.
[Optional] Additional context To Reproduce
Steps to reproduce the behavior:
1.
2.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered:
Describe the bug
Get Execution currently uses gorm First which imposes an order by on all executions by id. Even though id is indexed this ordering is not necessary and adds significantly to the query plan
(ignore the inner seq scan, i think that's an artifact of using a small, local test db).
Furthermore, for relational workflows (e.g. relaunch) we look up the parent workflow on every get just to retrieve the full parent execution identifier. This can simply be captured once, at child/reference workflow execution launch time.
Expected behavior
Gets on workflow executions should be performant.
[Optional] Additional context
To Reproduce
Steps to reproduce the behavior:
1.
2.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: