Rule Definition
Having complex queries in Functions can cause performance problems.
The most expensive step in the SQL preparation process is the generation of the execution plan, particularly when dealing with a query with multiple joins. When Oracle evaluates table join orders, it must consider every possible combination of tables. For example, a six-way table join has 720 (permutations of 6, or 6 * 5 * 4 * 3 * 2 * 1 = 720) possible ways that the tables can be joined together. This permutation issue becomes even more pronounced when you have more than 10 joined tables in a query: For a 15-way table join, there are over one trillion (1,307,674,368,000 to be exact) possible query permutations that must be evaluated.
Evaluation is dependend of the following Oracle configuration: optimizer_search_limit and optimizer_max_permutations. Thus the same query can have a different behavior depending on database configuration and joins with many queries are likely to be inefficient as the optimizer will likely stop computing permutations before reaching the best solution.
Remediation
Thes best solution is to review the query to reduce the number of involved Tables.
It is alwo possible to use the "odered hint".
Related Technologies
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.