Commit fae0e8d
committed
Merge branch 'feature/UpdateTopic-performance' into develop
While the `feature/track-dirty-relationships` (afa1e9b) greatly improved the performance of recursively saving a large topic hierarchy by avoiding unnecessary and expensive calls to the `UpdateTopic` stored procedure, it did nothing to make that call itself less expensive. This update fixes that by reviewing and optimizing the `UpdateTopic` stored procedure, while simultaneously including additional functionality. In testing, the stored procedure is about twice as fast as it was previously, taking 18 seconds to update ≈250 topics, instead of the previous 38 seconds. And that's _with_ a new subquery to ensure that none of the indexed attributes are duplicating their previous value—something we currently do in `SqlTopicRepository`, but which is preferably enforced by the stored procedure itself.
This update includes:
- Lookup `@PreviousExtendedAttributes` directly from `ExtendedAttributes` instead of going through `ExtendedAttributeIndex` (b76ac69)
- Explored various performance improvements to nested query for null attributes, but found the current query to be optimal (4035bcc)
- Applied nested query to indexed attributes handling in order to prevent duplicates from being created (78dd6cd)1 file changed
Lines changed: 25 additions & 13 deletions
Lines changed: 25 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
36 | 44 | | |
37 | | - | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
44 | | - | |
45 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| |||
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
80 | 99 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 100 | + | |
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| |||
0 commit comments