For every row found in the outer table, the database server searches for its corresponding row in the second (or inner) table.
对于在外部表中找到的每一行,数据库服务器将在第二个(或内部)表中搜索其相应的行。
If there is an index on the join column, the costs will be significantly less; otherwise the database server must perform table scans for all tables, both outer and inner tables.
如果连接列上有一个索引,那么其成本会相当低;否则,数据库服务器就必须对所有表(外部和内部表)执行表扫描。
If the inner table does not have an index, the database server will compare the cost of building an index on the table to the cost of a sequential scan, and will choose the one with the least cost.
如果内部表没有索引,那么数据库服务器就会将在表上构建索引的成本与连续扫描的成本进行比较,然后选择成本最低的那一种方法。
应用推荐