Purge Circulations: Better selection logic
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 18 Jun 2012 17:07:56 +0000 (13:07 -0400)
committerJason Stephenson <jason@sigio.com>
Wed, 30 Jan 2013 20:17:15 +0000 (15:17 -0500)
commit92f5dec509090cb83d83f923d6d8cb6fa910ae50
tree782d8fb58406f86246286c39fbf1271241c54032
parent95d04cfa40eb944df38451f4b9dc480b78cb96f7
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