PostgreSQL load driven up by overzealous pruning of old ipdevpoll_job_log entries in NAV 4.2.5

Bug #1437318 reported by Morten Brekkevold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
High
Morten Brekkevold

Bug Description

NAV 4.2.5 introduced a fix for bug logging. In conjunction with this, a different regime for pruning old entries from the ipdevpoll_job_log tables was introduced.

Pruning is done via the trigger `trig_trim_old_ipdevpoll_job_log_entries_on_insert`, which runs on every insert, but performs a full table clean on about 20% of inserts by use of the RANDOM() function.

The full table clean statement is quite costly on a large table, and running for 20% of INSERTs has proven too ambitious, since this means 20% of inserts to this table will be unbearably slow.

Of course, this basically amounts to log rotation, and doesn't really belong in a trigger. It should run periodically, outside of the database, and independent of inserts to the table.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
milestone: none → 4.2.6
status: Confirmed → Fix Committed
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.