Viewing 4 posts - 1 through 5 (of 5 total)
You're 100% correct. How did you know?
I've stared at these execution plans for a few days, they're so simple and I didn't see it. How can you tell?
March 25, 2014 at 9:17 am
Without the data, the scenario is worthless. The backup only has one table and one index so you can run/see the query. It's specially created for this exact...
March 25, 2014 at 9:00 am
https://www.dropbox.com/s/jd4mgt64zk80nsc/TestScenario.zip here's a backup file.
SELECT LIParent.ItemID as ParentID, LIChild.ItemID as ChildID FROM TItems LIParent
INNER JOIN TItems LIChild ON LIChild.HID.IsDescendantOf(LIParent.HID)=1
WHERE LIParent.NodeType = 0 AND LIChild.NodeType = 1
AND LIParent.TreeID...
March 25, 2014 at 8:22 am
Sorry for not posting the exec plan. Here you go https://www.dropbox.com/s/mmjthlfryvsr4l4/Execution%20plan.xml
Yes, the TreeID is a GUID/UNIQUEIDENTIFIER. The IsDescendentOf(..) query is built into the MS HIERARCHYID datatype in SQL...
March 25, 2014 at 7:40 am
Viewing 4 posts - 1 through 5 (of 5 total)