LP#1482757: Speed Up the Delete of Orphaned URIs in upgrade script
authorJason Stephenson <jason@sigio.com>
Thu, 24 Sep 2020 16:31:23 +0000 (12:31 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Fri, 25 Feb 2022 21:00:57 +0000 (16:00 -0500)
commitd6cfdd597c68da3cbfbc1986128507ee7cb230df
tree06dc9b180cd1ae15ab4d3c03074abe5745b2373c
parent70835d8a94d158445d933b1902188433115edca0
LP#1482757: Speed Up the Delete of Orphaned URIs in upgrade script

Modify the code that deletes orphaned asset.uri table entries in the
upgrade script to use IN logic on the subquery, because IN is much
faster than NOT IN.  Also take into account the link between
serial.item and asset.uri so that we don't accidentally delete URIs
used by serial items.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql