The data in the class_source table is not prone to frequent change, but is looked up for every biblio, biblioitem and item imported, resulting in needless DB calls and slowness. Caching this relatively static data would provide a moderate performance boost to importing, particularly bulkmarcimport.pl
Still valid?
Created attachment 170076 [details] [review] Bug 23387: Add caching to C4::ClassSource These routines ultimately need to be moved to the Koha namespace, for now though, we can reduce look ups during import and batch modification by caching the values here for each request To test: 1 - prove -v t/db_dependent/ClassSources.t 2 - Import some records with items, confirm cn_sort values correctly built 3 - Edit some items, confirm cn_Sort correclty built
(In reply to Katrin Fischer from comment #1) > Still valid? Yes, when migrating a library we noticed repeated lookups in the class sources tables from bulkmarcimport We should go further and move to these to Koha namespace and cache at a deeper level, however, this will offer a benefit now and is a minor change
Created attachment 170659 [details] [review] Bug 23387: Add caching to C4::ClassSource These routines ultimately need to be moved to the Koha namespace, for now though, we can reduce look ups during import and batch modification by caching the values here for each request To test: 1 - prove -v t/db_dependent/ClassSources.t 2 - Import some records with items, confirm cn_sort values correctly built 3 - Edit some items, confirm cn_Sort correclty built Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 170685 [details] [review] Bug 23387: Add caching to C4::ClassSource These routines ultimately need to be moved to the Koha namespace, for now though, we can reduce look ups during import and batch modification by caching the values here for each request To test: 1 - prove -v t/db_dependent/ClassSources.t 2 - Import some records with items, confirm cn_sort values correctly built 3 - Edit some items, confirm cn_Sort correclty built Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Clear code, well tested, noticeable improvement. Passing QA
Pushed for 24.11! Well done everyone, thank you!