[Bug 13146] New: Improve GetRecordValue function by caching field mapping
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Bug ID: 13146 Summary: Improve GetRecordValue function by caching field mapping Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: frederic@tamil.fr QA Contact: testopia@bugs.koha-community.org 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. The Koha cache system should be used here, as for framework structure for example. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |frederic@tamil.fr -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 --- Comment #1 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 32735 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32735&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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32735|0 |1 is obsolete| | --- Comment #2 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 32749 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32749&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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Frédéric, It would be great to provide a couple of tests to confirm the patch does not introduce any regressions. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Joonas Kylmälä <j.kylmala@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |j.kylmala@gmail.com --- Comment #4 from Joonas Kylmälä <j.kylmala@gmail.com> --- Looks like the results are the same with or without the patch. Also the SQL calls disappeared (good!). But I'm not sure what is subtitle field mapping. Is it about MARC records subfield something? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32749|0 |1 is obsolete| | --- Comment #5 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 44132 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44132&action=edit Bug 13146 UT Run the test before applying the second patch: prove -v t/db_dependent/FieldMapping.t Apply the 2nd patch, and redo the test. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 --- Comment #6 from Frédéric Demians <frederic@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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13146 --- Comment #7 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #3)
Frédéric, It would be great to provide a couple of tests to confirm the patch does not introduce any regressions.
Done. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org