diff --git a/arc-core/src/main/resources/BdD/script_function_utility.sql b/arc-core/src/main/resources/BdD/script_function_utility.sql index a40cc745c..7dd76d0c8 100644 --- a/arc-core/src/main/resources/BdD/script_function_utility.sql +++ b/arc-core/src/main/resources/BdD/script_function_utility.sql @@ -1,5 +1,20 @@ CREATE SCHEMA IF NOT EXISTS arc; +-- optimization parameters at database level +do $$ +declare +c record; +BEGIN +for c in (select current_database() as n) loop +execute 'alter database '||c.n||' set enable_bitmapscan=off;'; +execute 'alter database '||c.n||' set synchronous_commit=off;'; +execute 'alter database '||c.n||' set max_parallel_workers_per_gather=0;'; +execute 'alter database '||c.n||' set max_parallel_maintenance_workers=0;'; +execute 'alter database '||c.n||' set jit=off;'; +end loop; +end; +$$; + -- grant / revoke REVOKE ALL ON SCHEMA public FROM public; REVOKE ALL ON SCHEMA arc FROM public; diff --git a/arc-core/src/main/resources/BdD/script_global.sql b/arc-core/src/main/resources/BdD/script_global.sql index bc0d2f25e..08dd6fd0d 100644 --- a/arc-core/src/main/resources/BdD/script_global.sql +++ b/arc-core/src/main/resources/BdD/script_global.sql @@ -23,22 +23,6 @@ ON INSERT TO arc.parameter where exists (select from arc.parameter a where a.key=new.key) do instead nothing; - --- optimization parameters at database level -do $$ -declare -c record; -BEGIN -for c in (select current_database() as n) loop -execute 'alter database '||c.n||' set enable_bitmapscan=off;'; -execute 'alter database '||c.n||' set synchronous_commit=off;'; -execute 'alter database '||c.n||' set max_parallel_workers_per_gather=0;'; -execute 'alter database '||c.n||' set max_parallel_maintenance_workers=0;'; -execute 'alter database '||c.n||' set jit=off;'; -end loop; -end; -$$; - -- batch initialization parameters INSERT INTO arc.parameter VALUES ('ApiInitialisationService.Nb_Jour_A_Conserver','365'); UPDATE arc.parameter set description='parameter.batch.initialization.numberOfDayToKeepAfterRetrievedByAllCLients' where key='ApiInitialisationService.Nb_Jour_A_Conserver';