pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedTriggers or code?
3+ messages / 3 participants
[nested] [flat]
* Triggers or code?
@ 2010-08-23 18:42 DM <dm.aeqa@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: DM @ 2010-08-23 18:42 UTC (permalink / raw)
To: pgsql-performance
Hello There,
I have a table x and a history table x_hist, whats the best way to update
the history table.
should i need to use triggers or embed a code in my script to update the
history table?
what is the performance impact of a trigger versus embedding the code in the
script?
thanks for your time.
- Deepak
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Triggers or code?
@ 2010-08-23 19:13 André Fernandes <andre.de.camargo.fernandes@hotmail.com>
parent: DM <dm.aeqa@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: André Fernandes @ 2010-08-23 19:13 UTC (permalink / raw)
To: dm.aeqa@gmail.com; pgsql-performance
Trigger is the way to go.
André.
Date: Mon, 23 Aug 2010 11:42:21 -0700
Subject: [PERFORM] Triggers or code?
From: dm.aeqa@gmail.com
To: pgsql-performance@postgresql.org
Hello There,
I have a table x and a history table x_hist, whats the best way to update the history table.
should i need to use triggers or embed a code in my script to update the history table?
what is the performance impact of a trigger versus embedding the code in the script?
thanks for your time.
- Deepak
=
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Triggers or code?
@ 2010-08-25 14:30 Bob Lunney <bob_lunney@yahoo.com>
parent: DM <dm.aeqa@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Bob Lunney @ 2010-08-25 14:30 UTC (permalink / raw)
To: pgsql-performance@postgresql.org, DM <dm.aeqa@gmail.com>
That depends on your application's requirements. If a transaction on table X fails, do you still want the history (noting the failure)? If so, go with embedding the code in your script. If you only want history for successful transactions, a trigger will take care of that for you automatically.
Bob Lunney
--- On Mon, 8/23/10, DM <dm.aeqa@gmail.com> wrote:
From: DM <dm.aeqa@gmail.com>
Subject: [PERFORM] Triggers or code?
To: pgsql-performance@postgresql.org
Date: Monday, August 23, 2010, 2:42 PM
Hello There,
I have a table x and a history table x_hist, whats the best way to update the history table.
should i need to use triggers or embed a code in my script to update the history table?
what is the performance impact of a trigger versus embedding the code in the script?
thanks for your time.
- Deepak
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2010-08-25 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 18:42 Triggers or code? DM <dm.aeqa@gmail.com>
2010-08-23 19:13 ` André Fernandes <andre.de.camargo.fernandes@hotmail.com>
2010-08-25 14:30 ` Bob Lunney <bob_lunney@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox