Why would this query cause a Merge Cartesian Join in Oracle -


I have a query to modify recently.

here is the original

  select "status", as the RTRIM (status). // Other fields X hours qualified from schema WHERE hours & gt; 0 and payment = 'RGW' and not (schema. Choose from table2 y, where y.position = x.position)  

here is the new version

 < Code> Select "Status", as the RTRIM (Position). // Other fields X hours qualified from schema WHERE hours & gt; 0 and payment = 'RGW' and no (choose from slam table2 where y.date = get_fiscal_year_start_date (SYSDATE) and y.position = x.position)  

UDF Get_fiscal_year_start_date () gives the starting date of the financial year for the date parameter, the first query runs fine, but the second creates a merge in the carzaceon joint. I saw the indexes on the tables and found that both the position and the date were indexed. My question for you is stackoverflow, because of the addition of y.date = get_fiscal_year_start_date (SYSDATE) due to the addition of a merge cartesian in Oracle 10g. The problem is, Oracle does not know that get_fiscal_year_start_date (SYSDATE) is a single

Obviously I do not have a hand test, but this version of your question should be included in the merge Cartesian.

  select "status", as RTRIM (status). // Other fields Choose x from the schema, (get_fiscal_year_start_date (SYSDATE) as the double-term fiscal year) Ferries WHERE hours & gt; 0 and payment = 'RGW' and not (select from schematic 2Y where y.date = fy.fiscal_year and y.position = x.position)  

Oracle knows that DUAL is a line, and is because the sub-query will return a value.


Comments