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

Tech - Amélioration des performances de la requête des PNOs #3741

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

louptheron
Copy link
Collaborator

@louptheron louptheron commented Oct 4, 2024

Linked issues


  • Tests E2E (Cypress)

Copy link

sonarqubecloud bot commented Oct 4, 2024

@@ -68,10 +71,8 @@ class GetPriorNotifications(
incompletePriorNotifications
.map { priorNotification ->
priorNotification.enrich(allRiskFactors, allPorts, priorNotification.isManuallyCreated)
priorNotification.logbookMessageAndValue.logbookMessage
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On ne calcule pas les noms dans chaque message PNO avant de faire le dernier filtre de pagination

@@ -137,8 +138,12 @@ class GetPriorNotifications(
val (enrichedPaginatedList, enrichedPaginatedListTimeTaken) =
measureTimedValue {
paginatedList.apply {
val reportings = getReportings()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Au lieu de faire X fois la requête findAll, on la fait une seule fois

.filter { it.isManuallyCreated }
.mapNotNull { it.logbookMessageAndValue.logbookMessage.vesselId }
.distinct()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On re met pas dans la clause IN les doublons, ça permet d'avoir moins de données à transiter en IN/OUT

@louptheron louptheron merged commit 5c88c3c into master Oct 7, 2024
26 checks passed
@louptheron louptheron deleted the loup/work_on_use_case_perf branch October 7, 2024 07:15
@ivangabriele ivangabriele added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tech - Améliorer la requête SQL des PNOs
2 participants