Problem/Motivation

The Workspace module (#2784921: Add Workspaces experimental module) will be making heavy use of entity revisions by swapping each loaded entity with the revision assigned to a specific workspace. This will add one database query for each entity that is swapped, because we only have a "single load" method for revisions.

Proposed resolution

Add a loadMultipleRevisions() method to the entity storage.

Remaining tasks

Review.

User interface changes

Nope.

API changes

API addition: a new loadMultipleRevisions() method is added to \Drupal\Core\Entity\EntityStorageInterface and all the storages provide a base implementation for it.

Data model changes

Nope.

CommentFileSizeAuthor
#2 2912562.patch23.18 KBamateescu

Comments

amateescu created an issue. See original summary.

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new23.18 KB

This should do it.

berdir’s picture

I thought we have existing issues for this. We certainly have #2620980: Add static and persistent caching to ContentEntityStorageBase::loadRevision()

catch’s picture

I think the duplicate is #1730874: Add support for loading multiple revisions at once. It doesn't have any patches since 2012 but we should definitely merge one way or the other.

amateescu’s picture

Status: Needs review » Closed (duplicate)

Ok then, let's use the older issue. I moved over my patch to #1730874-24: Add support for loading multiple revisions at once.