title: Oracle CTE performance issue
body: <p>In order to make the comparison case insensitive but display correctly we written below query </p>
  
  <pre><code>WITH VALUE_LIST
       AS (SELECT *
             FROM (SELECT m1."ASSIGNMENT" col#0,
                          m1."ASSIGNEE_NAME" col#1,
                          ROW_NUMBER ()
                          OVER (
                             PARTITION BY m1."ASSIGNMENT", m1."ASSIGNEE_NAME"
                             ORDER BY m1."ASSIGNMENT", m1."ASSIGNEE_NAME")
                             ROW_INDEX
                     FROM PROBSUMMARYM1 m1)
            WHERE ROW_INDEX = 1)
  SELECT vl.col#0, vl.col#1, GROUPED_DATA.CNT
    FROM (  SELECT UPPER (m1."ASSIGNMENT") col#0,
                   UPPER (m1."ASSIGNEE_NAME") col#1,
                   COUNT (*) CNT
              FROM PROBSUMMARYM1 m1
          GROUP BY UPPER (m1."ASSIGNMENT"), UPPER (m1."ASSIGNEE_NAME")
          ORDER BY UPPER (m1."ASSIGNMENT") ASC, UPPER (m1."ASSIGNEE_NAME") ASC)
         GROUPED_DATA,
         VALUE_LIST vl
   WHERE     (   GROUPED_DATA.col#0 = UPPER (vl.col#0)
              OR (GROUPED_DATA.col#0 IS NULL AND vl.col#0 IS NULL))
         AND (   GROUPED_DATA.col#1 = UPPER (vl.col#1)
              OR (GROUPED_DATA.col#1 IS NULL AND vl.col#1 IS NULL))
  </code></pre>
  
  <p>But with the group numbers growing the performance degrade significantly. 
  Is there any query can get the same query but no performance issue?   </p>