[Koha-bugs] [Bug 24027] Adding multiple items is slow

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 31 22:22:29 CET 2020


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

Michal Denar <black23 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #95473|0                           |1
        is obsolete|                            |

--- Comment #14 from Michal Denar <black23 at gmail.com> ---
Created attachment 98250
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98250&action=edit
Bug 24027: Call ModZebra only once after all items have been added

Why happened:
- call to ModZebra was done after EACH item added,
  but it was called only with main biblionumber only,
  so call was the same on each of requests
- and also time spent in that ModZebra sub increased with every
  next hundred items in DB for that element: so adding every next 100
  was slower and slower,

Solved:
- now it's called only once (by adding some extra parameter to "AddItem*" sub
set in postponed mode)
- and now adding of elements not so heavily depends from how much items was in
DB before.

Test plan / How to replicate the issue:
(test depends from how already populated DB and Zebra/Elasticsearch DBs
 so might be not so noticeably fast on empty DBs)

- go to one of bibliotitems cataloguing/additem.pl?biblionumber=XXX pages
- press button "add multiple copies of this item", put 1000 on slower machines,
5000 on faster
- start measuring time + submit page/form

It takes some amount of time even up to timeout.
After applying patch, run the same procedure for same number of items.
Note: it goes fast in both variants on empty database so time not so
noticeable (also depents how ModZebra-related stuff is configured).

Also it slows more linearly when number of items grows.

But, again, it heavily depends how database is populated and indexes are
rebuild
but it's obvious that it will me much more efficient to call "ModZebra" once
after 1000 addings, then call it 1000 times on each item created in the loop.

Signed-off-by: Michal Denar <black23 at gmail.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list