Re: Writing Trigger Functions in C

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Writing Trigger Functions in C
Дата
Msg-id CAHyXU0zXgMeWbxeE4ra40jN7L7Z7-_4C_sG1L8eaO8t=xqt3DQ@mail.gmail.com
обсуждение исходный текст
Ответ на Writing Trigger Functions in C  (Charles Gomes <charlesrg@outlook.com>)
Ответы Re: Writing Trigger Functions in C
Список pgsql-hackers
On Fri, Dec 21, 2012 at 10:25 AM, Charles Gomes <charlesrg@outlook.com> wrote:
> Hello guys,
>
> I've been finding performance issues when using a trigger to modify inserts on a partitioned table.
> If using the trigger the total time goes from 1 Hour to 4 hours.
>
> The trigger is pretty simple:
>
> CREATE OR REPLACE FUNCTION quotes_insert_trigger()
> RETURNS trigger AS $$
> BEGIN
> EXECUTE 'INSERT INTO quotes_'|| to_char(new.received_time,'YYYY_MM_DD') ||' VALUES (($1).*)' USING NEW ;
> RETURN NULL;
> END;
> $$
> LANGUAGE plpgsql;
>
> I've seen that some of you guys have worked on writing triggers in C.
>
> Does anyone have had an experience writing a trigger for partitioning in C ?
>
> If you have some code to paste so I can start from I will really appreciate.

Honestly I'd leave the trigger alone and modify the client code in
performance sensitive places to insert directly to the correct
partition table.

merlin



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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Event Triggers: adding information
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Writing Trigger Functions in C