Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] FlyteAdmin GetExecution performance slow #879

Closed
katrogan opened this issue Mar 30, 2021 · 1 comment
Closed

[BUG] FlyteAdmin GetExecution performance slow #879

katrogan opened this issue Mar 30, 2021 · 1 comment
Assignees
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service
Milestone

Comments

@katrogan
Copy link
Contributor

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.

@katrogan katrogan added bug Something isn't working flyteadmin Issue for FlyteAdmin Service labels Mar 30, 2021
@katrogan katrogan added this to the 0.12.0 milestone Mar 30, 2021
@katrogan katrogan self-assigned this Mar 30, 2021
@EngHabu
Copy link
Contributor

EngHabu commented Apr 1, 2021

Done

@EngHabu EngHabu closed this as completed Apr 1, 2021
eapolinario pushed a commit to eapolinario/flyte that referenced this issue Dec 20, 2022
…plugins/whylogs_examples (flyteorg#879)

Bump oauthlib

Bumps [oauthlib](https://github.com/oauthlib/oauthlib) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/oauthlib/oauthlib/releases)
- [Changelog](https://github.com/oauthlib/oauthlib/blob/master/CHANGELOG.rst)
- [Commits](oauthlib/oauthlib@v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: oauthlib
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service
Projects
None yet
Development

No branches or pull requests

2 participants