Skip to content

Improved the code for better performance and stability.

Трајковски Андреј requested to merge code-opt into dev

Performance & Stability Improvements

  • Optimized Excel export flows for offers/payments/allocations by using export-specific retrieval, instead of paged Integer.MAX_VALUE queries.
  • Refactored filter/sort handling in domain services to reuse shared specification/sort builders and reduce duplicated query logic.
  • Improved payment import performance by switching to batch persistence (saveAll) and removing unnecessary per-row optional/save overhead.
  • Added DB performance indexes via V1_17__add_performance_indexes.sql for the most-used filter/sort columns (prospect_code, archived, offer_id, embg, status, allocation_strategy).
  • Tuned runtime configuration in application.properties:
    • Hibernate batching/fetch tuning
    • Hikari pool sizing/timeouts
    • Thymeleaf cache enabled
    • spring.jpa.open-in-view=false
  • Reduced index-unfriendly text filtering by introducing prefix-based filtering (value%) for ID/code-like fields instead of generic %value% matching.
  • Added eager fetch (@EntityGraph) for payment list spec query to avoid lazy loading issues after disabling open-in-view.

Merge request reports

Loading