U4-6994 - Repository level performance enhancements - remaining N+1 queries

Created by Shannon Deminick 20 Aug 2015, 08:04:30 Updated by Shannon Deminick 16 Nov 2016, 13:01:36

Relates to: U4-5427

Relates to: U4-5618

The remaining known N+1 queries are:

ScheduledPublish

VersionableRepositoryBase.GetAllVersions

ContentRepository.GetByPublishedVersion

Comments

Stephan 09 Nov 2016, 14:12:05

also: Relation[Type]Repository


Stephan 09 Nov 2016, 14:37:38

Relation[Type]Repository fixed by U4-9077


Stephan 09 Nov 2016, 15:21:58

ContentRepository.GetByPublishedVersion calls CreateContentFromDto which calls GetPropertyCollection which runs a SQL query to retrieve the properties - for each dto. Yet GetPropertyCollection already supports getting properties for multiple dtos at once = refactoring...


Stephan 09 Nov 2016, 17:36:34

As for ScheduledPublish... it ends up using contentRepository.GetByQuery which as far as I can tell is going to run 1+1 query (+ maybe 1 if tags) but not N+1 - so considering it ok.


Stephan 14 Nov 2016, 17:16:28

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


Stephan 14 Nov 2016, 17:49:14

review = code review, + all tests should be green


Sebastiaan Janssen 15 Nov 2016, 17:43:04

This all looks absolutely fine to me and it works as well in my tests, I would like to get @Shandem to give it another look though just to be sure I'm not missing something.


Shannon Deminick 16 Nov 2016, 13:01:26

Looks ok to me, hard to fully grasp the changes without a complete analysis of the logic but the code looks fine and if unit tests are passing - and they do test all of this - then we can assume it's ok. I can't see anything obvious that will cause issues.


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 46

Story Points:

Cycle: