After upgrading to 8.4 we noticed a performance decrease on one of our sites. The page that is taking minutes to load is a multilanguage page with several field collections and revisions enabled.
Some debugging lead me to the change in issue 2864995.
This change introduces a latestRevision() method which is used by QuickEdit (this explains why it is only when logged in). On a field collection that has about 4000 revisions, this query takes seconds to run.
If I understand correctly the change introduces a self-join to the base revision table. Because of this, for each revision in the table, a set of revisions + next revisions is added to the result. From this result only the row that has no next revision (is null) is used (in my case 7000000 rows are searched for the one that has no next revisions).
base_table.revision_id | base_table_2.revision_id |
---|---|
... | ... |
335916 | 335986 |
335916 | 336066 |
335986 | 336066 |
336066 | NULL |
Maybe we can think of a more efficient way of querying the latest revision?