U4-9615 - Performance issue: Anytime a document is visited in the back office, ALL of it's ancestors are looked up

Created by Shannon Deminick 09 Mar 2017, 17:22:07 Updated by Shannon Deminick 28 Mar 2017, 05:04:58

Relates to: U4-9617

Subtask of: U4-9609

The reason for this is to determine if the node exists underneath a list view node and which one that is, unfortunately the APIs used will actually lookup every real IContent object for all ancestors which is a lot of complex queries when this can be one very simple query to get an ID.

Comments

Shannon Deminick 20 Mar 2017, 10:11:48

Check if we do this same thing to create a breadcrumb


Stephan 23 Mar 2017, 12:32:44

Notes:

ContentItemDisplay.IsChildOfListView set in ContentModelMapper.AfterMap as content.Ancestors().FirstOrDefault(x => x.ContentType.IsContainer) - which ends up splitting the path and then ContentRepository.GetAll(ids) - effectively loading all the ancestors.

Assuming we really want IsChildOfListView to recurse on all ancestors (and not depend solely on the parent) we'd need a new service/repository method.


Stephan 23 Mar 2017, 13:09:45

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

review: editing content, under a list view as well as not under a list view, should still work, and in addition (using eg sql profiler) one should see only 1 query for isContainer.

note: implemented via internal methods on ContentTypeServiceBase and ContentTypeBaseRepository so the interfaces don't change and we can ship in a minor.


Shannon Deminick 28 Mar 2017, 04:57:16

I've changed the interfaces, we are allowed to change these and they are not considered breaking changes - we do it all the time and it's documented these are not breaking changes. The reason is because people cannot implement these interfaces and use them directly in a running application, of course their unit test projects may need to be rebuilt but that's about it. Also the repository interfaces are already internal.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.5.12

Sprint: Sprint 55

Story Points: 1

Cycle: