https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43125

            Bug ID: 43125
           Summary: Rewrite FixPriority to use a single bulk UPDATE
                    instead of per-hold updates
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Hold requests
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
            Blocks: 43123
  Target Milestone: ---

C4::Reserves::FixPriority currently issues one UPDATE reserves SET priority = ?
per non-captured hold on a biblio, on every hold create, cancel or fill. A
popular title with 50 queued holds generates 50 individual UPDATE statements on
every state change. The function carries its own FIXME comment noting it needs
to be rewritten.

Replace the per-hold UPDATE loop with a single bulk UPDATE (for example using
UPDATE ... CASE WHEN reserve_id IN (...) THEN ... END, or an equivalent bulk
statement), preserving the existing priority ordering semantics exactly.

This bug is independent of the REST API and Vue work and can be delivered on
its own.

Test plan
1. Run t/db_dependent/Reserves.t and confirm all FixPriority related tests pass
unchanged.
2. Add a test with a large number of queued holds (50+) and assert the
resulting priority values match the pre-patch behaviour.
3. Confirm the number of UPDATE statements issued no longer scales with the
number of queued holds.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43123
[Bug 43123] Hold placement workflow: Vue modernisation (epic)
-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to