Skip to content

Commit

Permalink
fix: database configuration set on executor pods too
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Nov 9, 2023
1 parent a8e9810 commit 5db873c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
15 changes: 15 additions & 0 deletions arc-core/src/main/resources/BdD/script_function_utility.sql
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
16 changes: 0 additions & 16 deletions arc-core/src/main/resources/BdD/script_global.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 5db873c

Please sign in to comment.