Why does this trigger slow down updates so much
Your trigger performs two distinct actions.


It "end-dates" the old record in the tableA_records table.
It inserts a fresh copy of the new record into the tableA_records table.


Without seeing how the tableA_Records audit table is constructed, I can't be sure if one step is causing more problems than the other, but some questions you can ask and steps to try:


Is there an index on the tableA_records.tableA_id column? There should be.
What other indexes are on the tableA_records table? Are they necessary? Are they well designed?
Have you tried commenting out the update statement, then testing the trigger, then uncommenting that and commenting the insert statement and retesting? This will tell you if the update or the insert is slower.


I suspect you'll find that more of your delay is caused by the update than the insert, since an update requires scanning through either an index or a full-table scan to find the appropriate row. Make sure that column is properly indexed.

If other columns in tableA_records table are indexed, then look to see if that index is needed. Having too many indexes will slow down inserts.