Fixes #26225: Add index and FORCE INDEX for listLastTestCaseResultsForTestSuite (MySQL)#26235
Fixes #26225: Add index and FORCE INDEX for listLastTestCaseResultsForTestSuite (MySQL)#26235TeddyCr merged 13 commits intoopen-metadata:mainfrom
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java
Show resolved
Hide resolved
🔍 CI failure analysis for 16ce08a: All CI failures are unrelated to this PR's SQL migration and DAO changes. They are pre-existing infrastructure, flakiness, or external repository issues.IssueNone of the CI failures are related to this PR. The PR only modifies:
Root CauseAll failures are pre-existing infrastructure issues, test environment flakiness, failures in external repositories, or unrelated connector/E2E regressions. Details1. Test environment teardown ordering issue with DJL vector embedding — unrelated to this PR. The 2. This is a CI environment/token configuration issue unrelated to this PR's SQL migration and DAO changes. 3. Triggers a downstream workflow in 4.
None involve 5. Two Oracle tests fail in Code Review 👍 Approved with suggestions 0 resolved / 2 findingsAdds FORCE INDEX directives to the listLastTestCaseResultsForTestSuite query for MySQL performance optimization. Consider also applying FORCE INDEX to the related listLastTestCaseResult query and adding blank lines between migration statements for consistency. 💡 Performance:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Fixes ISSUE-26225
PR Description
Short blurb
What changes did you make?
idx_entity_timestamp_descondata_quality_data_time_series (entityFQNHash, timestamp DESC)in the 1.12.2 MySQL and Postgres migrations.@SqlQueryforlistLastTestCaseResultsForTestSuiteinCollectionDAOwith two@ConnectionAwareSqlQueryvariants: MySQL usesFORCE INDEX (idx_entity_timestamp_desc)on the anti-join; Postgres keeps the same SQL without a hint.Why did you make them?
listLastTestCaseResultsForTestSuitewas very slow (~20–42s) on MySQL because the optimizer did not pick an efficient plan for the anti-join. That query runs on every test suite pipeline completion and caused slow responses and Hikari connection warnings. Adding the index and usingFORCE INDEXon MySQL brought the query down to ~0.5s.How did you test your changes?
I worked on adding an index and MySQL FORCE INDEX for
listLastTestCaseResultsForTestSuitebecause the query was very slow (~20–42s) on MySQL and caused slow test suite pipeline completion and Hikari connection warnings. With the index and hint, the query runs in ~0.5s.Type of change:
Checklist:
Fixes <issue-number>: <short explanation>