Subject Re: Advice needed on speed between triggers and application inserts/updates
Author bimmer_r
To give you my best answer I would need some more info about then complexity of the triggers.

But Im going to try anyways.

I dont think the main issue is speed (I know that is what you wrote). But think about it. Having the complex business rules in code will only slow down your application - and furthermore it will certainly move the potential error focus from the server to your application.

Given the last statement I allways go for the trigger solution.

But again - I need more information about the job at hand - to give a better answer.

Kind Regards
Bimmer_R


--- In firebird-support@yahoogroups.com, "cornievs" <cornievs@...> wrote:
>
> I am a developer of accounting software and mostly learned my "trade" by trail and error and from this forum. (Thanks for all the info and tips I receive daily on this forum.)
>
> Setup:
> Delphi XE2 + DBX + Firebird 2.5x
> Firebird mostly running on dual core pentiums, Windows XP/7 Pro.
> Workstations = Celerons +, running the application exclusively
>
> To date I have used mostly "On Insert / On Update" triggers to insert or update tables that must be update when a certain record is posted. For example: On the sale of an item, I must post a record to the Salesperson Commission table, update the quantities on hand in the Stock Table etc. But due to the complexity of for example the commission structures I am thinking of moving it to the application.
>
> The question is: How much slower/faster will 5 SQL statements issue from the application be compared to 1 SQL statement with 4 inserts/updates inside a trigger?
>
> Or I am missing some bigger issue here?
>
> Thanks for advice
>
> Cornie van Schoor
> InfoStar Software
> South Africa
>