Cme 206 performance#2889
Open
AntonyLeons wants to merge 8 commits into
Open
Conversation
…dex migrations for case data metadata
AntonyLeons
commented
May 22, 2026
| } | ||
|
|
||
| @Override | ||
| public String buildClauseString(String operation) { |
Contributor
Author
There was a problem hiding this comment.
replacing date(column) = ? with a half-open timestamp range keeps the predicate sargable, so Postgres can use the existing timestamp indexes.
AntonyLeons
commented
May 22, 2026
| criteria.forEach(criterion -> criterion.bindParameters(query)); | ||
| } | ||
|
|
||
| private String buildQueryString(boolean isCountQuery, String whereClausePart, MetaData metadata) { |
Contributor
Author
There was a problem hiding this comment.
count queries no longer build an unused sort clause, avoiding unnecessary work
…dd warning about Open Session in View
AntonyLeons
commented
May 26, 2026
| + " AND cae.createdDate = " | ||
| + "(select min(caeDate.createdDate) from CaseAuditEventEntity caeDate WHERE caeDate.caseDataId = :" | ||
| + CaseAuditEventEntity.CASE_DATA_ID + ")" | ||
| + " ORDER BY cae.createdDate ASC" |
Contributor
Author
There was a problem hiding this comment.
remove subquery, and sort instead of using min
AntonyLeons
commented
May 26, 2026
| spring.datasource.hikari.maximum-pool-size=${DATA_STORE_DB_MAX_POOL_SIZE:16} | ||
| # WARNING: disabling Open Session in View means lazy JPA associations must be loaded/mapped inside service or | ||
| # repository transactions. Accessing lazy associations during response serialization can cause LazyInitializationException. | ||
| spring.jpa.open-in-view=false |
Contributor
Author
There was a problem hiding this comment.
slight;y dangerous so could remove and merge in a future pr, but good best practice change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before creating a pull request make sure that:
keep-helmlabel has been added, if the helm release should be persisted after a successful buildPlease remove this line and everything above and fill the following sections:
JIRA link (if applicable)
https://tools.hmcts.net/jira/browse/CME-206
Change description
Does this PR introduce a breaking change? (check one with "x")