The triggers in uni-temporal have been rewritten in order to take advantage of the performance optimizations discovered in the bi-temporal generator. At the same time, the check constraints have been removed in favor of AFTER triggers, which are more lenient (but still correct) when inserting several versions at once. Early tests indicate the following improvements:
- Insert 1 million rows into latest view of empty anchor:
88 seconds with old trigger logic and check constraints
44 seconds with new logic
- Insert another 1 million rows with 50% restatements:
64 seconds with old trigger logic and check constraints
46 seconds with new logic
- Insert another 1 million rows with 100% restatements:
37 seconds with old trigger logic and check constraints
42 seconds with new logic
As can be seen, the performance difference is almost negligible for the new logic, regardless of the number of restatements. The only test in which the old logic performs slightly better is when every inserted row is a restatement, which is an uncommon (and probably unrealistic) scenario.
The new logic can be tested in the test version of the online modeler, now at version 0.99.9.0.