Performance of moderation control state filter is slow

Created on 10 December 2021, about 3 years ago
Updated 30 January 2023, about 2 years ago

Problem/Motivation

When building a view based on content revisions which uses the moderation control state filter, it takes a long time for the query to finish executing. With large data sets (+1 000 000 rows) it takes more than a minute to execute the query. This is a huge performance issue which makes it impossible to use a moderation state filter in conjunction with showing content revisions.

Steps to reproduce

You'll need a large data set to see the performance issue clearly
- Fresh install
- Enable content moderation
- Create a content revisions view
- Add a moderation control state filter

Proposed resolution

Create an index for moderation state in the content moderation state field revision table. Doing this would decrease the query execution time to a fraction. Testing by creating the index directly in the db made the execution time go from > 1 min to < 1 second.

Remaining tasks

1. Create patch which adds an index to moderation state field revision table
2. Add tests

πŸ“Œ Task
Status

Needs work

Version

10.1 ✨

Component
Content moderationΒ  β†’

Last updated 3 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΊAustralia @Sam152
Created by

πŸ‡ΈπŸ‡ͺSweden erikbrgn

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024