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!

Question on Join determination - book from Dan Tow "SQL Tuning"

TimWong765May 10 2016 — edited May 10 2016

HI,

I have a general question on the book from Dan Tow on "SQL Tuning".

He recommends in chapter 6 "Deducing the best execution plan" a Standard heuristic join order:

1.) Drive first to the table with the best (nearest to Zero) filter ratio

Why does the filter Ratio determine the first table?

Why does not the table with the lowest number of rows (including application of a filter) determine the first table?

Example:

Table A has 100Mio rows and a filter might result in 10Mio rows (filters down to 10%)

Table B has 20Mio rows and a filter might result in 5Mio rows (filters down to 25%)

According to the book, table A has the best filter and therefore determines the start. But table B would have less rows after applying the filter.

This post has been answered by Jonathan Lewis on May 10 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2016
Added on May 10 2016
2 comments
593 views