Bug 37487

Summary: import_records missing index on upload_timestamp field
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Cook 2024-07-26 02:38:55 UTC
cleanup_database.pl deletes import_records and import_batches based on import_records.upload_timestamp, but this isn't an indexed field.

That means the database needs to do a row scan through all rows in order to find which rows to delete. This is inefficient, so it's slow when you have a large number of rows.