[Koha-bugs] [Bug 1084] would be nice to remove records from breeding tables.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Aug 2 14:46:26 CEST 2011


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

Paul Poulain <paul.poulain at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #5 from Paul Poulain <paul.poulain at biblibre.com> 2011-08-02 12:46:26 UTC ---
well spotted Katrin.

This could easily be achieved with the following SQL requests :

DELETE FROM import_records WHERE import_batch_id IN (SELECT
import_batches.import_batch_id FROM import_batches WHERE
import_batches.batch_type ="z3950") AND import_records.upload_timestamp<=
DATE_SUB(now(), INTERVAL 1 DAY);

DELETE FROM import_batches WHERE import_batch_id NOT IN (SELECT DISTINCT
import_batch_id from import_records);

The 1st request deletes all z3950 entries that are older than one day (too much
from far, but harmless)
The 2nd request deletes the "fake batch header" that is generated on each z3950
query

We can put those SQLs in 2 places:
* on any z3950 search = before doing the new search, clean the database. Easy
to setup, efficient, although a little loss of performances. I think this loss
of performance is small compared to how long z3950 servers answer
* add a script to cronjob, that cleans every night. A little bit harder to
write, and has to be setup during installation, which put some pain to the
sysadmin.

I prefer the 1st option, let me know which one you prefer.

-- 
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