Question: Edit : I need the program to do computational faster, the update process is needed to be real time (calculating 100.000 to 200.000 records for about 0-5 seconds), this process will be doing in multi threading (about 2-8 thread)

---

I will create program that will update data in database. The update process will be triggered if I do insert data in table. The update process will computational costly. This is the idea of my update process :

1. I will have 3 tables (A,B,C) and each of it will have data aroud 100.000-200.000 records
2. I will have table D to save table A, B, C record count
3. I will have table E to save table A, B, C, D calculation, the calculation including multiplication, division and log base 2
4. I will insert data to table A, B, C and after that data in table D and E must be updated
5. This process can be repeated 3-5 times in every update

Which one is computationally faster, doing update programmatically or using trigger?

Answer: 
Better to go with `TRIGGERS` and keep this complexity on DB side. This will help you in keeping your code clean. If you are going to do `INSERT` from different files then you may need to rewrite `UPDATE` logic in all those files.

And if in future you need to change the after insert logic then you just need to update your trigger instead of updating the code.
A trigger will be faster as it will work closest to the data and you will not have to transfer data between the database and the program layer. The problem with a trigger is that it will be triggered for every insert. Is that something that you want or would you prefer to only do the computation once a lot of data (ie many inserts) has been inserted.