"驱动表是在使用多表嵌套连接时,会先全表扫描该驱动表,然后驱动表返回的结果集中一行一行去匹配被驱动表(可以利用索引),所以我们会选择小表做为驱动表,而被驱动使用索引进行连接。对于基于规则的优化系统,驱动表在FROM后是有次序设置的,而在基于成本的优化,ORACLE会选择最合适的驱动表。
"
so seems 驱动表=outer table...
there's no simple way to estimate which table db2 will pickup as outer table, it is based on cost estimation.... usually db2 will pickup the table with less rows as outer table... but still, in reality it's based on cost model, not a simple rule like "always pick the table with less rows as outer table"....