Optimize database writes when re-saving a pending revision as the default one

Created on 27 October 2025, 2 days ago

Problem/Motivation

Followup for 🐛 Impossible to save a pending revision as the default one without creating a new revision RTBC , where @berdir proposed this:

And is it worth optimizing the code below for this case? Meaning, only delete and re-insert the default revision tables and not the revision tables? That would half the number of writes and would be a considerable speed boost for publishing a workspace, no?

We already have a condition on the $query->execute(), so we already now prepare the query and then ignore it for a non-default revision save. that means we just need to add a condition (maybe prepare a flag up here?) on two existing if conditions?

Proposed resolution

Update SqlContentEntityStorage to only update base tables (both shared and dedicated) when re-saving a pending revision as a default one.

Remaining tasks

Do it :)

User interface changes

Nope.

Introduced terminology

N/A

API changes

Nope.

Data model changes

Nope.

Release notes snippet

TBD.

📌 Task
Status

Active

Version

11.0 🔥

Component

entity system

Created by

🇷🇴Romania amateescu

Live updates comments and jobs are added and updated live.
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.

No activities found.

Production build 0.71.5 2024