| From: | "Marc Mamin" <M(dot)Mamin(at)intershop(dot)de> |
|---|---|
| To: | <pgsql-admin(at)postgresql(dot)org> |
| Subject: | how can I get "initial_value"(setting_name) ? |
| Date: | 2011-09-12 09:59:37 |
| Message-ID: | C4DAC901169B624F933534A26ED7DF310861B099@JENMAIL01.ad.intershop.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
differentiated memory settings
Hello,
I need to implement differentiate memory settings in order to favor some
given operations.
(see function below)
I miss an admin function to reset the settings to the initial values.
Do I oversight something ?
For the case such a function is not yet available, I guess that
following may prove useful:
- reset_setting (setting_name [, is_local])
- (read)initial_value(setting_name)
best regards,
Marc Mamin
CREATE OR REPLACE FUNCTION public.cic_set_memory_plan (p_plan varchar)
returns int AS
$$
BEGIN
--LSORT, MSORT, LMAINT, RESET
if p_plan = 'RESET' then
SELECT set_config('work_mem', ???), false);
SELECT set_config('maintenance_work_mem', ??, false);
elsif p_plan = 'LSORT' then
SELECT set_config('work_mem', current_setting('cic.large_sortmem'),
false);
elsif p_plan = 'MSORT' then
SELECT set_config('work_mem', current_setting('cic.mid_sortmem'),
false);
elsif p_plan = 'LMAINT' then
SELECT set_config('maintenance_work_mem',
current_setting('cic.large_maintenance_mem'), false);
else
raise warning 'cic_set_memory_plan called with unsupportted parameter:
%', p_plan;
end if;
return 0;
END;
$$
language 'PLPGSQL' VOLATILE;
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Guillaume Lelarge | 2011-09-12 10:15:53 | Re: how can I get "initial_value"(setting_name) ? |
| Previous Message | Alejandro | 2011-09-11 18:57:08 | Re: Estimate physical index size |