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

            Bug ID: 33554
           Summary: searching  borrowers is a lot slower if there's
                    searchable extended attributes.
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Patrons
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]
        Depends on: 30055

Hi,

Since BZ 30055 search is using the REST API.

For a library with 80,000 borrowers and  800,000 borrower_attributes, (one
searchable per borrower), searching a borrower is twice as slow and is
noticeable in checkin/checkout.

before 30055 the request was something like :
SELECT borrowernumber FROM borrowers 
WHERE firstname` LIKE '%foo%' 
OR middle_name LIKE '%foo%' 
OR surname LIKE '%foo%' 
OR othernames LIKE '%foo%' 
OR cardnumber LIKE '%foo%' 
OR userid LIKE '%foo%'
OR borrowernumber in ( 
  select borrowernumber from borrower_attributes where attribute LIKE '%foo%'
AND code = 'BAR' ) 
GROUP BY borrowernumber;
runtime 0.069 sec

in master
SELECT borrowernumber FROM borrowers 
LEFT JOIN borrower_attributes USING(borrowernumber) 
WHERE firstname` LIKE '%foo%' 
OR middle_name LIKE '%foo%' 
OR surname LIKE '%foo%' 
OR othernames LIKE '%foo%' 
OR cardnumber LIKE '%foo%' 
OR userid LIKE '%foo%'
OR (attribute LIKE '%foo%' AND code = 'BAR' ) 
GROUP BY borrowernumber;

runtime 1.324 sec


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30055
[Bug 30055] Rewrite some of the patron searches to make them use the REST API
routes
-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
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/

Reply via email to