| From: | Charles Gomes <charlesrg(at)outlook(dot)com> |
|---|---|
| To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Writing Trigger Functions in C |
| Date: | 2012-12-21 16:25:03 |
| Message-ID: | BLU002-W73C697267F89044EC56E1FAB360@phx.gbl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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.
Thanks
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Stehule | 2012-12-21 16:28:49 | Re: PL/PgSQL STRICT |
| Previous Message | Tom Lane | 2012-12-21 16:22:03 | Re: PL/PgSQL STRICT |