sql server - MS SQL Triggers used instead of Views -
This is my first question, please be diligent.
In the company in which I currently work, we use MS SQL Server for database of financial products and everything that is connected with it and is a main application used by customers. Goes (within internal customers - company).
The previous programmer has created the database in this way every single payment that matches one row in the table (since we have made different payments since different tables for that matter) is a trigger Which calculates the balance of the entire contract - which can sometimes end up to more than 60 seconds .... Usually it does not take more than 15, but still it looks silly (slow) is. To mention that the system is not a transaction ... nevertheless ... and possibly 15+ long transactions can not be done.
I have proposed that all those triggers should be cut (only they should be left to take care of the historical tables) and should be done by all calculation scenes.
Of course I can not even introduce the transaction in this system because after every simple single entry there is a trigger which runs 15 s ...
And my question is, For both of you you can see what the harm and the benefits are (I have to accept that I like the second solution) What can you tell me from my experience? Will I reconstruct or trigger them to trigger them and will only get rid of them and use the scene.
RK
We have similar financial requirements in our company. I can tell that many unnecessary triggers are bad, it suppresses the system and slows load times (we load a lot of data)
However I can say that in the end "depends" what the game is. Are you trying to show these "calculation" values in a report that the user runs on some portals? anything else? What I am trying to figure out here is "Do calculation values need to be calculated in the database? Is it not necessary, it can not be calculated?"
In this way we work and when thoughts work, I would recommend making SQL Functions instead of using your best optimization practices.
Comments
Post a Comment