LP#1482757: Speed Up the Delete of Orphaned URIs in upgrade script collab/dyrcona/lp1482757
authorJason Stephenson <jason@sigio.com>
Thu, 24 Sep 2020 16:31:23 +0000 (12:31 -0400)
committerJason Stephenson <jason@sigio.com>
Thu, 24 Sep 2020 16:31:23 +0000 (12:31 -0400)
commit9597e01d2b86a9d766804d7070e28a9346ad2c9a
tree83c95c508266721ef3d0ac716dba4ac15bebe458
parent5e96e2ff15198eee819ea9f683b30dd475a848e8
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>
Open-ILS/src/sql/Pg/upgrade/XXXX.function.biblio.extract_located_uris.sql