Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark 49 posts 130 karma points
    May 15, 2014 @ 03:23
    Mark
    0

    Query on Umbraco SQL performance

    Hey, just have a few questions regarding the number of SQL queries generated using typical query functionality.

    Are the number of SQL queries generated due to the application being in debug mode? Worth noting that these sql queries only occur when the application is reset on first view, and not every browser refresh - however would have assumed much of this information would be coming from umbraco.config, not DB queries?

    eg. for linq style queries on IPublishedContent to generate menus such as

    Root.Children.Where(x => x.IsVisible());

    and corresponding view

    @foreach (var page in Model.MainMenu) {
      var active = page.IsAncestorOrSelf(Model.Content) ? "class=\"active\"" : "";
      <li @Html.Raw(active)><a href="@page.Url">@page.Name</a></li>
    }

    It generates over 100 SQL queries - 64 of them (with duplicates) related to that view code

     

Please Sign in or register to post replies

Write your reply to:

Draft