It may come from sorts (explicit or implicit ones, eg GROUP BY)
especially if they take place on disk, or from big hash joins that would
also take place on disk. With 27 tables the number of combinations is
rather high and the optimizer can be forgiven for getting confused. As a
first approach, and since the number of returned rows is low, I would
try to favor a nested loop approach with a hint in the FIRST ROWS
family. Unfortunately I doubt it will be enough. I suspect that there is
a rather selective criterion in your query that doesn't look so to Oracle.
You may find this useful:
http://roughsea.com/article.php3?id_article=60
HTH
Stéphane Faroult
I've got a monster join (27 tables) coming from my Baan ERP app. It's taking 0.00 seconds to parse and only .05 seconds to fetch, but is taking 15.05 seconds for the execute phase - see below from tkprof:
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
----------
Parse 1 0.00 0.00 0 0 0
0
Execute 2 13.94 15.05 0 0 0
0
Fetch 4 0.00 0.05 16 420 0
22
------- ------ -------- ---------- ---------- ---------- ----------
----------
total 7 13.94 15.12 16 420 0
22
I've never seen a SELECT query with such a high Execute time before -
usually only DML queries take time in this phase and SELECT queries
spend their time in the Fetch phase. Any ideas what would cause this
behaviour? Oracle version 10.2.0.2 on AIX 5.3
If you want to see the query and explain plan, let me know and I'd be happy to provide it - I just didn't include it here because it's huge and I'm not sure it's relevant.
Thanks, Brandon
Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.
-- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l