From b37a259ae51f6d8b0db097270c5e0f5ce8af91ba Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 12 Sep 2013 13:26:21 -0400 Subject: [PATCH] Keep standard INNER joins above possible OUTERs We always join metabib.record_attr, and we always use an INNER join to the core table, so keep that join first. Likewise with the join to biblio.record_entry. Dynamic joins may be OUTER, though, and while join reordering in Postgres is smart, let's not give it the chance to fail. Signed-off-by: Mike Rylander Signed-off-by: Ben Shum --- .../perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index 3a7f367669..7d0aae0607 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -802,9 +802,9 @@ SELECT $key AS id, $rank AS rank, FIRST(mrd.attrs->'date1') AS tie_break FROM metabib.metarecord_source_map m - $$flat_plan{from} $mra_join $bre_join + $$flat_plan{from} WHERE 1=1 $flat_where GROUP BY 1 -- 2.11.0