U4-9093 - Fix SQL used to rebuild the media & content xml structures in the data integrity check

Created by Shannon Deminick 21 Oct 2016, 14:13:48 Updated by Stephan 25 Oct 2016, 12:05:41

Subtask of: U4-9085

Fix SQL used to rebuild the media & content xml structures in the data integrity check, these calls get an SQL timeout when there's a lot of content or media

Comments

Shannon Deminick 21 Oct 2016, 14:21:14

PR: https://github.com/umbraco/Umbraco-CMS/pull/1539

Before this SQL was doing inneficient things:

  • When it was clearing all xml from the table for a certain type it was doing a join and a DISTINCT on an ID when in fact it only needs to lookup the IDs in a single table which is massively more efficient
  • When it was clearing all by content type, it was executing the delete statement for each content type when it can do this in one call, also this delete statement was performing multiple joins that were totally unnecessary and also doing a DISTINCT on an ID that doesn't have as fast of index as just querying on UmbracoNode

This is fixed for content, media and members


Stephan 25 Oct 2016, 12:05:35

Looks good, merged.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.5.5

Sprint: Sprint 45

Story Points:

Cycle: