U4-9546 - Paging in the media section performs poorly because it double queries for ALL child media

Created by Shannon Deminick 20 Feb 2017, 06:08:46 Updated by Claus Jensen 27 Feb 2017, 11:07:08

Relates to: U4-9545

Subtask of: U4-9548

When paging in the media section, the paging performance is nullified because what happens is:

  • A paging call is made
  • A few SQL calls are made which lookup only the content specific to the page being requested
  • Then the JS makes another call to get all media items that are 'folders' under the current child - this query returns ALL media items under the current parent which nullifies the performance achieved by only returning the paged data

There's a few things that should be done to fix this:

  • The MediaController.GetChildFolders can be highly optimized, this will go retrieve every single media item under a node and determine it's type and filter it in memory
  • The JS shouldn't need to make a call to this over and over, based on the data returned from the paging call it can determine what is a folder type


Shannon Deminick 20 Feb 2017, 07:13:15

The JS has been fixed, there was actually no reason for it to make another request to determine which items are folders or not. If we did want to make this a server side data we could add some metaData to the item as IsFolder, but the check I've done in JS is the exact check we'd do in c# anyways so I think it's fine. So now when loading a set of 10 media items, it is not also fetching every single media item under the parent to also filter them (in memory). This is a rather large performance oversight.

Fixed in commit: 27164093eaf223cf1a66a810e0fb5d2fe19ff135

Will be part of PR for http://issues.umbraco.org/issue/U4-9545

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.5.11

Sprint: Sprint 53

Story Points: