When performing bulk inserts/deletes of comments (as in migration processes), calling _forum_update_forum_index() once for each comment is wasteful - it would be much more efficient for a bulk process to disable the individual updates and do a bulk update at the end. We faced this issue with node statistics previously, and added the comment_maintain_node_statistics variable for this purpose. It's tempting to piggy-back on that variable - certainly for my use case manipulating one variable rather than two would be simpler - but it may be cleaner to introduce a new one.
See #1715402: Poor performance of _forum_update_forum_index() when passed a non-forum node for another _forum_update_forum_index performance optimization.
Comment | File | Size | Author |
---|---|---|---|
#1 | forum-index_update_disable-1715450-1.patch | 2.52 KB | mikeryan |
Comments
Comment #1
mikeryanSo, one would programmatically set forum_maintain_index to FALSE, and take responsibility for calling _forum_update_forum_index when done with all bulk updates.
Comment #16
quietone CreditAttribution: quietone at PreviousNext commentedForum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to the contributed extension once the Drupal 11 branch is open.