1

I have some optimization problem with Oracle 11g database. I got query with structure as below:

select
    (....)
from
    (select ...)
where
    (...)
CONNECT BY
    PRIOR J.JDN_ID_POD = J.JDN_ID_NAD and (HUGE_CONDITION)
START WITH
    J.JDN_ID_NAD = 1 and (HUGE_CONDITION)

and because of HUGE_CONDITION is really huge (~3500 characters) and is in two places, the query is very slow; is there any way to do it in another way?

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Pablo
  • 11
  • 2
  • 3
    The number of characters in your condition has 100% no relation with the query's performance (except parsing). – Mat Mar 18 '13 at 09:12
  • The query is most likely "slow" because you're full-scanning your tables because your conditions mean you're not using any indexes (or because it's quicker to not use the indexes). You do know your WHERE is applied _after_ the CONNECT BY right? You might not be restricting rows in the way that you think there fore increasing the amount of work you're doing. – Ben Mar 18 '13 at 09:16

0 Answers0