Skip to content

Commit

Permalink
Tech - Amélioration des performances d'une requête logbook (#3950)
Browse files Browse the repository at this point in the history
## Linked issues

- Fix `findFirstAcknowledgedDateOfTripBeforeDateTime` query perf

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
louptheron authored Dec 5, 2024
2 parents af1c42f + 8c1cee4 commit 539dd33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,10 @@ class JpaLogbookReportRepository(
).first()

return dbLogbookReportRepository.findFirstAcknowledgedDateOfTrip(
internalReferenceNumber,
lastTrip.tripNumber,
internalReferenceNumber = internalReferenceNumber,
tripNumber = lastTrip.tripNumber,
startDate = lastTrip.startDate,
endDate = lastTrip.endDate,
).atZone(
UTC,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ interface DBLogbookReportRepository :
"""WITH dat_cor AS (
SELECT *
FROM logbook_reports e
WHERE e.cfr = ?1
AND e.trip_number = ?2
WHERE e.cfr = :internalReferenceNumber
AND e.trip_number = :tripNumber
AND operation_datetime_utc >= :startDate
AND operation_datetime_utc <= :endDate
AND NOT e.is_test_message
),
ret AS (
Expand All @@ -356,6 +358,8 @@ interface DBLogbookReportRepository :
fun findFirstAcknowledgedDateOfTrip(
internalReferenceNumber: String,
tripNumber: String,
startDate: Instant,
endDate: Instant,
): Instant

@Query(
Expand Down

0 comments on commit 539dd33

Please sign in to comment.