Break up expensive queries, match index to quals
authorMike Rylander <mrylander@gmail.com>
Fri, 19 Jul 2013 16:35:31 +0000 (12:35 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 19 Jul 2013 16:35:31 +0000 (12:35 -0400)
commit23b2be5464043d452a4aaae64801d40936552408
tree3652e8b87c19095e64c1dddd3c779f91e32d6a52
parentca2696640c78ebcfb03e22a62920dbe7fc548b52
Break up expensive queries, match index to quals

First, we order browse queries over MBE by (sort_value, value) so we
want to match the unique index to that.

We're only going to use the first few rows of the cursors we build from
the back/forward MBE paging queries, and the embedded GROUP BY defeats
the planners desire to use an index for ordering the rows. So, instead,
we use a simpler core query and gather aggregate data as a secondary,
index-capable query for each MBE row.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib-auth-browse.sql