Change record status: 
Project: 
Introduced in branch: 
7.x
Introduced in version: 
7.79
Description: 

Background information about this change

Performance and scalability improvement opt-in for existing installs, enabled for new installations.

This is a backport for Drupal 7 of a performance and scalability improvement introduced in Drupal 8.

This change introduces a check in field SQL storage when saving entities which avoids unnecessary writes when content has apparently not changed. This can deliver a significant performance improvement, especially for sites with high-frequency writes and/or those with many fields. See #2470619: Do not attempt field storage write when field content did not change for details.

The performance gains reported for some migrations are noteworthy with one report of a migration which previously took 70+ hours taking less than 1 hour, and around a 50 percent performance improvement reported by others. (See comments #70 and #77 in the aforementioned issue.)

Installation and setup instructions

  • On fresh installs this will be enabled by default, for existing sites, it's an opt-in.
  • See the instructions in the newly updated default.settings.php
  • add this setting to your settings.php
    $conf['field_sql_storage_skip_writing_unchanged_fields'] = TRUE;
    
Impacts: 
Site builders, administrators, editors
Module developers
Distribution developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

Phizes’s picture

While we make use of this functionality, a word of caution for anyone whom may be in the edge case of changing an entities bundle type on save. This can lead to data loss, but it is definitely an edge case. This will apply to both new sites, and sites which opt in.

I have outlined this scenario in a bug report, as well as a patch which is updated to account for the prior patch now being in core.
https://www.drupal.org/project/drupal/issues/3210388

Again though, this feature can make a significant difference depending on your workload. Don't be put off by the existence of an obscure edge case.