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

Kyle M Hall <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #36410|0                           |1
        is obsolete|                            |
  Attachment #36411|0                           |1
        is obsolete|                            |

--- Comment #13 from Kyle M Hall <[email protected]> ---
Created attachment 36873
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36873&action=edit
[PASSED QA] Bug 13740: Remove the NOT NULL clause in GetBorrowersToExpunge

C4::Borrowers::GetBorrowersToExpunge should not use a "NOT IN", it is
not efficient at all.

With only 1 guarantor and more than 136k patrons, the not in clause in
this subroutine takes ages:
mysql> select count(*) FROM   borrowers where  borrowernumber NOT IN
(SELECT guarantorid FROM borrowers WHERE guarantorid IS NOT NULL AND
guarantorid <> 0) ;
[...]

not ended after 5min

With the query modified by this patch, the results come after 1 sec :)

Test plan:
Verify the delete_patrons.pl cronjob or the cleanborrowers tools work as
before.
Especially with guarantors.

Signed-off-by: Brendan Gallagher <[email protected]>

Signed-off-by: Koha Team AMU <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://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