Purge Circulations: Better selection logic
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 18 Jun 2012 17:07:56 +0000 (13:07 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 1 Feb 2013 14:54:34 +0000 (09:54 -0500)
commitfcf00b2b0e72e638098d0e64deed0e4bb09d3600
treefe461b8f1bc91e409b7b221742a79bdcea92c5aa
parent0a61ab95a6d77890d7f5c31cb4eaa3fb48a1b82b
Purge Circulations: Better selection logic

This attempts two things:

1 - Keep the number of circs the library wants based on the most recent
    circulations, regardless of user prefs and such.

    This is accomplished by changing the circ fetching query to use a
    window function in a subquery so we can filter on it easily.

    This also allowed removal of the purge position counter.

2 - Allow removal of circs that are between kept circs if they meet all
    other removal criteria.

    This is accomplished by using CONTINUE instead of EXIT in the loop.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/sql/Pg/090.schema.action.sql