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

2019-11-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24027

Andrew Nugged  changed:

   What|Removed |Added

  Attachment #95446|0   |1
is obsolete||

--- Comment #11 from Andrew Nugged  ---
Created attachment 95473
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95473=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.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 23992] Adding multiple items with barcode might end with infinite loop if same barcode will be next_value

2019-11-16 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23992

--- Comment #5 from Andrew Nugged  ---
(In reply to Jonathan Druart from comment #3)

Also we had discussion about "sequence" of barcodes with KohaSuomi
community/cataloguers but I still unclear in vision.

Do librarians needs to insert barcodes for items in the middle as THEY want? 
Or is it enough to number barcodes from free space from the max? 
Or fill randomly from given incrementally skipping existing ones and no matter
how they spreaded, just should be unique and different?
Is these requirements worldwide or they need some settings + interface feedback
about skipps/stopped generator/etc?

I proposed just to print error/do partial add/inform user when barcode sequence
generated not as "user may expect", if users expects barcodes to start from
their own wished barcode. 

But I don't have answer then "should we also inform that some barcode numbers
were skipped"?
Example of the situation: if user will put first barcode which occupied, system
will increment barcodes until free gap, and user will get all items numbered
with totally diferent barcodes instead of that which he/she put on the
beginning, and this even won't give any feedback to user. Should that be so?

Maybe – we should inform user that sequence was broken (jumped over occupied
barcode, empty next one generated, barcode not re-generated), and stop?

I brought this question + partial solution here as WIP/unclear. Will
re-translate this my message to IRC chat then.

And thanks for you that you're joined this small brainstorming :).

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/