Copied to clipboard

Flag this post as spam?

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


  • skiltz 501 posts 701 karma points
    Jun 26, 2013 @ 04:59
    skiltz
    0

    @uQuery how to debug broken nodes, slow queries

    I have an old umbraco solution thats been upgraded many times.  We have thousands of nodes.  We are currently running Umbraco 6.0.6.

    I've just started playing around with Umbraco Views and have found when querying (using @uQuery) some queries  are slow (> 1 second).  Does anyone have any idea how I could debug this and figure which nodes are causing the problems or if nodes have become orphans??

    Here is one of my queries.  Works fine on some nodes, not no much others.

    @Html.Partial("~/Views/Partials/_FlexSlider.cshtml", @uQuery.GetNode(1389).GetDescendantNodesByType("Textpage").Where(g=>g.GetProperty("isHomePageFeature").Value == "1").OrderByDescending(n => n.CreateDate).Take(4))

    Thanks,
    Matthew

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 26, 2013 @ 05:29
    Tom Fulton
    0

    Hi Matthew,

    I'm not sure the best way to truly debug this, but my first guess would be the GetDescendantNodesByType call.  Is the tree at 1389 really deep?  I'd avoid using Descendants if you can and instead use Children, though this might not be possible in your structure?

  • skiltz 501 posts 701 karma points
    Jun 26, 2013 @ 05:45
    skiltz
    0

    Hi Tom

    Thanks for the reply.  Yep 1389 is the MOTHERSHIP node, everything hangs off it. GetChildrenNodesBYType does work a heap faster, but that only goes 1 level deep which doesn't help in this situation, hmmm just need to get the latest created douments, maybe there is a better way.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 26, 2013 @ 18:15
    Tom Fulton
    100

    I wonder if doing a raw xpath query might perform better - not sure if the issue is traversing the XML or casting to the Node object.  Maybe you could try something like

    uQuery.GetNodesByXml("//* [@isDoc][isHomePageFeature = '1']")

    Otherwise, not sure if possible in your situation, but maybe instead of checking a box on each node you could use an MNTP to select them on the page they'll be used?

    -Tom

  • skiltz 501 posts 701 karma points
    Jun 26, 2013 @ 21:57
    skiltz
    0

    Thanks Tom.  I'll probably just cache the results for now and move along :)  Appreciate the help.

     

Please Sign in or register to post replies

Write your reply to:

Draft