• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

catmaid / CATMAID / 6693
45%
master: 45%

Build:
Build:
LAST BUILD BRANCH: dev
DEFAULT BRANCH: master
Ran 29 Nov 2019 10:59PM UTC
Jobs 3
Files 212
Run time 307min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6693

push

travis-ci

tomka
History tracking: make update/delete trigger more efficient

This database migration modifies the trigger setup of the history
tracking system of CATMAID. If history tracking is enabled, so far any
UPDATE and DELETE statement would execute a trigger function for every
touched row that would insert its old version into the table's history
table. This trigger function would also update the modified row's
transaction ID with a reference to the current transaction.

The latter part hast to happen for each row, because Postgres will not
allow us to modify updated rows (to store the transaction ID) in a
statement-level trigger. However, the first part, moving the old data to
the history table can happen on a per-statement basis, replacing N
INSERT statements with a single on. In larger setups this makes a
significant difference.

As an example, consider a well tuned server with most the database's
active set sitting in memory and a treenode table with ~800,000,000
treenodes in which we split off a fragment of ~9,000 nodes from a bigger
skeleton. So far the break-down of trigger behavior looked like this:.

 Trigger on_change_update_history_regular: time=953.769 calls=9215
 Trigger on_edit_treenode: time=35.184 calls=9215
 Trigger on_edit_treenode_check_review: time=19.663 calls=9215
 Trigger on_edit_treenode_update_summary_and_edges: time=2515.228 calls=1
 Trigger on_edit_treenode_update_suppressed_virtual_treenodes: time=17.984 calls=9215
 Trigger on_edit_treenode_update_treenode_connector_edges: time=19.190 calls=9215
 Execution Time: 4254.615 m

With the separation of the trigger behavior into two functions each, the
breakdown looks like this:

 Trigger on_change_update_history_regular: time=206.256 calls=1
 Trigger on_change_update_history_txid_regular: time=44.531 calls=9215
 Trigger on_edit_treenode: time=25.508 calls=9215
 Trigger on_edit_treenode_check_review: time=20.152 calls=9215
 Trigger on_edit_treenode_update_summary_and_edges: time=2529.471 c... (continued)

16695 of 37780 relevant lines covered (44.19%)

1.27 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6693.1 29 Nov 2019 10:59PM UTC 0
44.95
Travis Job 6693.1
2 6693.2 30 Nov 2019 04:07AM UTC 0
44.95
Travis Job 6693.2
3 6693.3 29 Nov 2019 11:13PM UTC 0
41.86
Travis Job 6693.3
Source Files on build 6693
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6693
  • e63fd217 on github
  • Prev Build on dev (#6691)
  • Next Build on dev (#6694)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc