[Koha-bugs] [Bug 6078] Patron with no checkout Report overload the server

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 10 11:14:38 CEST 2011


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

Chris Cormack <chris at bigballofwax.co.nz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
       Patch Status|Passed QA                   |Patch Pushed

--- Comment #5 from Chris Cormack <chris at bigballofwax.co.nz> 2011-08-10 09:14:38 UTC ---
Original query results in an execution plan of
+----+--------------------+------------+--------+-------------------------------+-------------------+---------+------+------+--------------------------+
| id | select_type        | table      | type   | possible_keys                
| key               | key_len | ref  | rows | Extra                    |
+----+--------------------+------------+--------+-------------------------------+-------------------+---------+------+------+--------------------------+
|  1 | PRIMARY            | borrowers  | index  | NULL                         
| PRIMARY           | 4       | NULL |   58 | Using where              |
|  2 | DEPENDENT SUBQUERY | <derived3> | system | NULL                         
| NULL              | NULL    | NULL |    1 |                          |
|  3 | DERIVED            | old_issues | range  | old_issuesborridx,old_bordate
| old_issuesborridx | 5       | NULL |    8 | Using where; Using index |
|  4 | UNION              | issues     | index  | NULL                         
| issuesborridx     | 5       | NULL |    1 | Using index              |
| NULL | UNION RESULT       | <union3,4> | ALL    | NULL                       
  | NULL              | NULL    | NULL | NULL |                          |
+----+--------------------+------------+--------+-------------------------------+-------------------+---------+------+------+--------------------------+

New query, is much better

+----+--------------------+------------+-------+-------------------------------+-------------------+---------+-------------------------------+------+--------------------------+
| id | select_type        | table      | type  | possible_keys                
| key               | key_len | ref                           | rows | Extra   
                |
+----+--------------------+------------+-------+-------------------------------+-------------------+---------+-------------------------------+------+--------------------------+
|  1 | PRIMARY            | borrowers  | index | NULL                         
| PRIMARY           | 4       | NULL                          |   58 | Using
where              |
|  3 | DEPENDENT SUBQUERY | old_issues | ref   | old_issuesborridx,old_bordate
| old_issuesborridx | 5       | koha.borrowers.borrowernumber |    8 | Using
where; Using index |
|  2 | DEPENDENT SUBQUERY | issues     | ref   | issuesborridx,bordate        
| issuesborridx     | 5       | koha.borrowers.borrowernumber |    1 | Using
where; Using index |
+----+--------------------+------------+-------+-------------------------------+-------------------+---------+-------------------------------+------+--------------------------+

Pushing, please test

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list