[OPEN-ILS-DEV] Deleting authority records, redundant authority.full_rec delete in rule
Josh Stompro
stomproj at exchange.larl.org
Fri Jun 1 10:17:44 EDT 2018
Hello, I'm working on cleaning up our authorities by removing the ones that are not being used, and I noticed that the delete protection rule[1] includes a call to delete entries from authority.full_record, which seems to be redundant. The aaa_auth_ingest_or_delete trigger (authority.indexing_ingest_or_delete)[2] also deletes entries from authority.full_rec when an authority is marked as deleted.
I'm just curious if this was by design or if it can be removed from the rule. The somewhat similar biblio.record_entry delete protection rule[3] doesn't include removing rows from biblio.full_rec or biblio.real_full_rec. But BRE seems to me much more complicated than ARE.
When I run explain analyze on a delete of an authority record, the triggers seem to take care of deleting the authority.full_rec rows before the rule for deleting them takes place, so the delete doesn't do anything.
The commit[4] that added that extra delete was from July 11th 2011 - and the commit that added removing authority.full_rec rows from the update trigger happened in Oct 20th 2010. So it seems like the trigger was in place before the rule was modified.
1 - http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/sql/Pg/011.schema.authority.sql;hb=HEAD#l288
2 - http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/sql/Pg/999.functions.global.sql#l1384
3 - http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/sql/Pg/800.fkeys.sql#l22
4 - http://git.evergreen-ils.org/?p=Evergreen.git;a=commit;h=3f8c866509587b066109a1051f82df0aef9d2b79
5 - http://git.evergreen-ils.org/?p=Evergreen.git;a=commit;h=151876a3cd45b03291cfcbf5ce25490950de9931
I'll file a bug if it seems like it makes sense to update the rule to remove the delete from authority.full_record.
Thanks
Josh
Lake Agassiz Regional Library - Moorhead MN larl.org
Josh Stompro | Office 218.233.3757 EXT-139
LARL IT Director | Cell 218.790.2110
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20180601/d0be6674/attachment.html>
More information about the Open-ils-dev
mailing list