[Koha-bugs] [Bug 13146] Improve GetRecordValue function by caching field mapping

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 28 17:32:11 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146

--- Comment #6 from Frédéric Demians <frederic at tamil.fr> ---
Created attachment 44133
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44133&action=edit
Bug 13146 Improve GetRecordValue function by caching field mapping

GetRecordValue function is called each time a specific field mapping is
required. For example, bug 12692 display biblio record subtitle for each hold
awaiting pickup or overdue. As it is implemented now, GetRecordValue queries
directly the fieldmapping table to determine in which tag/letter a field has to
be searched. It means, that the same mapping are requested over and over.

This patch uses Koha cache system to store a complete data structure
representing the field mapping.

TO TEST:

(1) Look at the code! and check that Koha caching system is properly used.

(2) Find out a Koha function where subtitle field mapping is used. Make you
    choice: sending a basket, tag list, overdues with fines, renew item, etc.

(3) Note that the display of subtitle field hasn't changed.

(4) If you really want to see how less queries are sent to MySQL with this
    patch, you have to monitor your MySQL log files!

    Suggestion to do it on a Debian box:

    - In MySQL client: SHOW VARIABLES LIKE "general_log%";
      It gives you MySQL log file path. Usually, /var/run/mysqld/mysqld.log
    - Enable log, with: SET GLOBAL general_log = 'ON';
    - Display a page displaying the subtitle field
    - Compare request send with/withouth this patch. Without the patch, you
      will see plenty of query like that:

      SELECT fieldcode, subfieldcode FROM fieldmapping

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


More information about the Koha-bugs mailing list