Skip to content

Commit

Permalink
improve query performances
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Dec 31, 2024
1 parent 48e77f8 commit 4e6977d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/alfio/manager/AccessService.java
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public void checkEventAndReservationOwnership(Principal principal, String eventN
var eventAndOrgId = checkEventOwnership(principal, eventName);
int countExisting;
if (partialIds) {
countExisting = reservationRepository.countReservationWithShortIdsForEvent(List.copyOf(reservationIds), eventAndOrgId.getId());
countExisting = reservationRepository.countReservationWithShortIdsForEvent(reservationIds.stream().map(String::toLowerCase).toList(), eventAndOrgId.getId());
} else {
countExisting = reservationRepository.countReservationsWithEventId(reservationIds, eventAndOrgId.getId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ int updateVatStatus(@Bind("reservationId") String reservationId,


@Query("""
SELECT count(id) from tickets_reservation where id ilike ANY(
SELECT count(id) from tickets_reservation where id like ANY(
select s || '%' from unnest(:ids::text[]) s(s)
) and event_id_fk = :eventId
""")
Expand Down

0 comments on commit 4e6977d

Please sign in to comment.