LP#
1419172 Optimize full_circ_count view to avoid seq scans
As reported by Chris Sharp:
"The reporter.classic_item_list view was modified in bug
1208572 to use
extend_reporter.full_circ_count to provide the use count for each item.
Unfortunately, this change was found to be the cause of consistently
long-running (2+ hours) reports queries in PINES as its query plan on
our PostgreSQL 9.3 server was resulting in sequential scans of both the
circulation and aged_circulation tables."
This commit restructures the view to avoid JOINs, and is in production
at PINES with noted improvement.
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Ben Shum <bshum@biblio.org>