Replace ElementPath exclusion constraints with triggers
Refs https://redmine.teklia.com/issues/4234#note-9
Benchmark
I added a parent to a top-level element that has 200K child elements, which should cause 200K calls to the ElementPath triggers, with a database that was causing the issues found in #1521 (closed) and https://redmine.teklia.com/issues/4234.
Query | master | !2020 (merged) |
---|---|---|
Get the current state in one SELECT | 146.035501s | 0.037321s |
Update the new child's own paths | 0.007515s | 0.003572s |
Update the child's children's recursively | 350.797377s | 325.720756s |
The large difference on the SELECT
is due to the query planner not using any of the GiST indexes for the exclusion constraints since they don't exist. The triggers do not seem to cause much of a difference during path management, and only trigger on INSERT
and UPDATE
on the paths which only occur during path management, so the only significant change is the removal of the GiST indexes, which we already have done in demo and we know makes things very faster.
Merge request reports
Activity
changed milestone to %Arkindex 1.5.0
added 7 commits
-
e16e9fbe...4dfbf7fa - 4 commits from branch
master
- b73ddf46 - Broken trigger implementation
- fde52fab - Fix the triggers
- 4e2b3491 - Fix tests
Toggle commit list-
e16e9fbe...4dfbf7fa - 4 commits from branch
added 6 commits
-
4e2b3491...ae07953d - 2 commits from branch
master
- 9992bdda - Broken trigger implementation
- a1a5d6e9 - Fix the triggers
- 0a8a8fa8 - Fix tests
- bfdb5e2c - Add a bunch of tests
Toggle commit list-
4e2b3491...ae07953d - 2 commits from branch
requested review from @babadie
added 7 commits
-
bfdb5e2c...16ad1d92 - 3 commits from branch
master
- a0c2a4b0 - Broken trigger implementation
- 43b012e1 - Fix the triggers
- 5546b4c7 - Fix tests
- 00f702f5 - Add a bunch of tests
Toggle commit list-
bfdb5e2c...16ad1d92 - 3 commits from branch
- Resolved by Bastien Abadie
mentioned in merge request !2044 (merged)