6 Replies Latest reply on Mar 7, 2016 12:43 PM by Stefan Koehler

    hint 'leading' 'ordered' issue when using 'count(distinct xxx)'

    lxmlhh

      Version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.

      When I join two tables use hash, and use 'leading' hint, it shows as below, t_userserviceinfo is drive table, i think it is ok even its cardinality is lagerer.

      1.jpg

       

      But when I query using 'count(distinct a.phonenumber)', leading drive table changed to t_personallib, it is not the table I specified.

      2.jpg

      I thought the drive table should be always the table a as I specified using 'leading(a)'.

      Why?