Comment 0 for bug 1695007

Revision history for this message
Bill Erickson (berick) wrote :

Evergreen circa 2.12

Primarily as a result of bug #1497335, aged circulation data is now exposed to the staff client (e.g. copy status interface). The data is exposed through the action.all_circulation DB view, which was originally created as a reporting tool. At query time, the view collects extra data on each circulation, specifically copy, call number, patron, and patron address data. It does this so the active circ data can mimic the anonymized form of the the aged circ data. While this is useful for reporting, the extra data collection and munging is overkill for the application, which generally just wants a thing that looks like an action.circulation.

I propose a leaner form of the view that only returns data living on the action.circulation and action.aged_circulation objects. Something like:

CREATE OR REPLACE VIEW action.all_circulation_slim AS
  SELECT * FROM action.circulation UNION ALL
  SELECT
   id,
   NULL AS usr,
   xact_start,
   -- list remaining columns that are shared by both tables
  FROM action.aged_circulation;

(Alternate VIEW name suggestions welcome)

This view would be used instead of action.all_circulation in the copy details API, action.all_circ_chain, action.summarize_all_circ_chain(), and any direct references to 'combcirc' in the browser client.

The goal is to reduce the effort required on the DB to load aged circ objects, while allowing the caller to flesh the copy data as needed. In cases where anonymized user data is required, then action.all_circulation will still be there.