A reader, May 11, 2025 - 7:22 pm UTC
Hi, Can you please advise if its recommended to create jobs from tiggers. Does this cause any performance issues in case of bulk inserts
May 12, 2025 - 3:10 am UTC
I would say that "depends" - a few things to consider
1) If you use DBMS_JOB, then this is transactional, ie, if the statement that was firing the trigger fails, then the jobs disappear without ever starting.
2) If you use DBMS_SCHEDULER, then its not, which means, even if the statement fails, those jobs are still there. That might be good ... it might be bad.
3) For bulk inserts, it strikes me as inefficient to launch a job for every row impacted. It might be a better option to assigh a single sequence number to all rows touched and use after-statement trigger to submit a single job to process all rows with that single sequence value.