Commit 1a2f1d6
committed
Introduce new 'DeleteOrphanedLastModifiedAttributes` maintenance procedure
Current versions on the OnTopic Library continue to write new `LastModified` attribute records every time a topic is saved in the OnTopic Editor—_even if no other attributes have been modified_. That's because the `LastModified` date is always different, and thus triggers the OnTopic Library's `IsDirty` check, which otherwise reduces non-changes from being saved. Over time, these values can add clutter to the database, reduce performance of some queries, and introduce a lot of "ghost" versions which don't represent _real_ versions. A future version of the OnTopic Library should develop a smarter way of evaluating these and conditionally saving them. In the meanwhile, however, they persist. As such, the `DeleteOrphanedLastModifiedAttributes` maintenance procedure will identify any orphaned `LastModified` attributes—i.e., ones whose `Version` doesn't map to any other modifications to indexed or extended attributes—and delete them. This can significantly reduce the amount of clutter and overall number of indexed attributes in the `Attributes` table. This may need to be run occassionally to prevent these from reaccumulating.1 parent 62589e2 commit 1a2f1d6
2 files changed
Lines changed: 56 additions & 0 deletions
File tree
- OnTopic.Data.Sql.Database
- Maintenance
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
0 commit comments