We have a table which is frequently updating. We have a scheduler to update this table which runs every 10 minutes. There are not more than 50k records in this table but when scheduler runs, database server consumes almost 100%. So now we are thinking to apply triggers on all tables that are used in this scheduler (which runs a SP to update that table) or should we make a simple view? Any help is appreciated. Thanks.
Triggers or views on frequently updating table
optimizationstored-procedurestriggerview
Related Question
- PostgreSQL – Tracking Current User Through Views and Triggers
- Mysql – Locking because of triggers thesql
- Making data fetching faster on VIEW
- Sql-server – Trigger performance – UPDATE statement joining on INSERTED
- Sql-server – Creating SQL Server triggers to copy a record from one table and populate another
- SQL Server Error – Updating Multiple Rows with Triggers
- Postgresql – ADD and DROP triggers frequently on a database
- Sql-server – Triggers vs. Jobs in SQL Server
Best Answer
Heavy CPU load suggests (to me) that there's lots of stuff happening in memory, which suggests poorly performing queries doing a lot of table scanning.
Look in the Slow Query log to see which queries are taking along time to run and look to tune them.