Re: Excessive memory used for INSERT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Excessive memory used for INSERT
Дата
Msg-id 17790.1418922345@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Excessive memory used for INSERT  (Alessandro Ipe <Alessandro.Ipe@meteo.be>)
Ответы Re: Excessive memory used for INSERT  (Alessandro Ipe <Alessandro.Ipe@meteo.be>)
Re: Excessive memory used for INSERT  (Alessandro Ipe <Alessandro.Ipe@meteo.be>)
Список pgsql-performance
Alessandro Ipe <Alessandro.Ipe@meteo.be> writes:
> Hi,
> I tried also with an upsert function
> CREATE FUNCTION upsert_func(sql_insert text, sql_update text) RETURNS void
>     LANGUAGE plpgsql
>     AS $$
> BEGIN
> EXECUTE sql_update;
> IF FOUND THEN
>         RETURN;
>     END IF;
>     BEGIN
> EXECUTE sql_insert;
> EXCEPTION WHEN OTHERS THEN
> EXECUTE sql_update;
> END;
>     RETURN;
> END;
> $$;
> with the same result on the memory used...

If you want to provide a self-contained test case, possibly we could look
into it, but these fragmentary bits of what you're doing don't really
constitute an investigatable problem statement.

I will note that EXCEPTION blocks aren't terribly cheap, so if you're
reaching the "EXECUTE sql_insert" a lot of times that might have something
to do with it.

            regards, tom lane


В списке pgsql-performance по дате отправления:

Предыдущее
От: Alessandro Ipe
Дата:
Сообщение: Re: Excessive memory used for INSERT
Следующее
От: Robert DiFalco
Дата:
Сообщение: Question about trigram GIST index