Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

lxmlhhMar 7 2016 — edited Mar 7 2016

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2016
Added on Mar 7 2016
6 comments
4,226 views