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.
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?
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.
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
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?
@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
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?
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.
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
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
Thanks Tom. I'll probably just cache the results for now and move along :) Appreciate the help.
is working on a reply...