Click here to Skip to main content
15,914,642 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel21-Dec-16 4:49
professionalSander Rossel21-Dec-16 4:49 
GeneralRe: Just an Oracle rant... PinPopular
PeejayAdams21-Dec-16 3:29
PeejayAdams21-Dec-16 3:29 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel21-Dec-16 4:44
professionalSander Rossel21-Dec-16 4:44 
GeneralRe: Just an Oracle rant... Pin
Wendelius21-Dec-16 5:28
mentorWendelius21-Dec-16 5:28 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel21-Dec-16 5:38
professionalSander Rossel21-Dec-16 5:38 
GeneralRe: Just an Oracle rant... Pin
Wendelius21-Dec-16 8:04
mentorWendelius21-Dec-16 8:04 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel21-Dec-16 23:24
professionalSander Rossel21-Dec-16 23:24 
GeneralRe: Just an Oracle rant... Pin
Jörgen Andersson21-Dec-16 10:34
professionalJörgen Andersson21-Dec-16 10:34 
Without seeing your actual query I can't say for sure, but connect by prior and joins doesn't cooperate well. That's quite well documented by the way. And fixed in later versions as well. Certain constructs are still not allowed, but then you'll get a proper error message.
A very simple workaround is usually to put the join inside a CTE.

Regarding the performance, you should always add two composite indexes on the table you're running CONNECT BY PRIOR on. One on (Id,ParentId) and one on (ParentId,Id).
Secondly, you should keep in mind that Connect by Prior does not behave like it's set based. You can compare it with a recursive CTE depth first instead of breadth first. So in this case the power comes at the cost of speed.
But what a power it is! Luckily I don't work with hierarchies anymore, as SQLServer sucks really badly at it.

Yes I know about the HierarchyID, and how someone could be allowed to implement a path enumeration model instead of an adjacency list or a nested set model, without getting flogged, is beyond my comprehension.
Wrong is evil and must be defeated. - Jeff Ello

GeneralRe: Just an Oracle rant... Pin
Sander Rossel21-Dec-16 23:22
professionalSander Rossel21-Dec-16 23:22 
GeneralRe: Just an Oracle rant... Pin
Jörgen Andersson22-Dec-16 1:00
professionalJörgen Andersson22-Dec-16 1:00 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel22-Dec-16 1:15
professionalSander Rossel22-Dec-16 1:15 
GeneralRe: Just an Oracle rant... Pin
Jörgen Andersson22-Dec-16 1:38
professionalJörgen Andersson22-Dec-16 1:38 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel22-Dec-16 1:41
professionalSander Rossel22-Dec-16 1:41 
GeneralRe: Just an Oracle rant... Pin
Jörgen Andersson23-Dec-16 7:46
professionalJörgen Andersson23-Dec-16 7:46 
GeneralRe: Just an Oracle rant... Pin
Sander Rossel24-Dec-16 1:03
professionalSander Rossel24-Dec-16 1:03 
GeneralCCC 21/12/17 Pin
PeejayAdams20-Dec-16 23:23
PeejayAdams20-Dec-16 23:23 
GeneralRe: CCC 21/12/17 Pin
OriginalGriff20-Dec-16 23:48
mveOriginalGriff20-Dec-16 23:48 
GeneralRe: CCC 21/12/17 Pin
pkfox21-Dec-16 0:01
professionalpkfox21-Dec-16 0:01 
GeneralRe: CCC 21/12/17 Pin
PeejayAdams21-Dec-16 0:12
PeejayAdams21-Dec-16 0:12 
GeneralRe: CCC 21/12/17 Pin
OriginalGriff21-Dec-16 0:16
mveOriginalGriff21-Dec-16 0:16 
GeneralRe: CCC 21/12/17 SOLVED Pin
PeejayAdams21-Dec-16 0:12
PeejayAdams21-Dec-16 0:12 
GeneralMQOTD Pin
V.20-Dec-16 20:54
professionalV.20-Dec-16 20:54 
GeneralRe: MQOTD Pin
OriginalGriff20-Dec-16 21:04
mveOriginalGriff20-Dec-16 21:04 
GeneralRe: MQOTD Pin
V.20-Dec-16 21:07
professionalV.20-Dec-16 21:07 
GeneralRe: MQOTD Pin
OriginalGriff20-Dec-16 21:13
mveOriginalGriff20-Dec-16 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.