From: Dan Wells Date: Tue, 29 Oct 2013 13:42:08 +0000 (-0400) Subject: Make browse pivot DB funcs STABLE X-Git-Tag: sprint4-merge-nov22~2531 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4b35a8cf5034092b6c64d848f09570c5fd5e3820;p=working%2FEvergreen.git Make browse pivot DB funcs STABLE Since these are just convenience functions doing only selects, these should be STABLE safe, and making this change allows browse to be functional on production-size data sets. Signed-off-by: Dan Wells Signed-off-by: Chris Sharp Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index 80768283b1..83200e287a 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -1823,7 +1823,7 @@ CREATE OR REPLACE FUNCTION metabib.browse_bib_pivot( ) WHERE mbe.sort_value >= public.naco_normalize($2) ORDER BY mbe.sort_value, mbe.value LIMIT 1; -$p$ LANGUAGE SQL; +$p$ LANGUAGE SQL STABLE; CREATE OR REPLACE FUNCTION metabib.browse_authority_pivot( INT[], @@ -1839,7 +1839,7 @@ CREATE OR REPLACE FUNCTION metabib.browse_authority_pivot( ) WHERE mbe.sort_value >= public.naco_normalize($2) ORDER BY mbe.sort_value, mbe.value LIMIT 1; -$p$ LANGUAGE SQL; +$p$ LANGUAGE SQL STABLE; CREATE OR REPLACE FUNCTION metabib.browse_authority_refs_pivot( INT[], @@ -1855,7 +1855,7 @@ CREATE OR REPLACE FUNCTION metabib.browse_authority_refs_pivot( ) WHERE mbe.sort_value >= public.naco_normalize($2) ORDER BY mbe.sort_value, mbe.value LIMIT 1; -$p$ LANGUAGE SQL; +$p$ LANGUAGE SQL STABLE; CREATE OR REPLACE FUNCTION metabib.browse_pivot( INT[], @@ -1867,7 +1867,7 @@ CREATE OR REPLACE FUNCTION metabib.browse_pivot( metabib.browse_authority_refs_pivot($1,$2) -- only look in 4xx, 5xx, 7xx of authority ) ORDER BY sort_value, value LIMIT 1; -$p$ LANGUAGE SQL; +$p$ LANGUAGE SQL STABLE; CREATE OR REPLACE FUNCTION metabib.staged_browse( diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.browse_pivots_stable.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.browse_pivots_stable.sql new file mode 100644 index 0000000000..3eaa44c8ab --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.browse_pivots_stable.sql @@ -0,0 +1,11 @@ +BEGIN; + +-- check whether patch can be applied +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +ALTER FUNCTION metabib.browse_pivot (integer[], text) STABLE; +ALTER FUNCTION metabib.browse_bib_pivot (integer[], text) STABLE; +ALTER FUNCTION metabib.browse_authority_pivot (integer[], text) STABLE; +ALTER FUNCTION metabib.browse_authority_refs_pivot (integer[], text) STABLE; + +COMMIT;