Sorting is required when no index satisfies the requested ordering of fetched rows, or the optimizer determines that a sort is less expensive than an index scan.
如果没有索引满足所取的行的要求顺序,或者优化器断定排序的代价低于索引扫描,那么就需要进行排序。
Typically, a non-matching index scan is chosen by the optimizer when the underlying index provides benefits such as index-only access, avoids sort, or some similar benefit.
通常情况下,在基础索引提供好处(如唯一索引访问、避免排序或一些类似的好处)时,可通过优化器选择非匹配索引扫描。
Therefore, when deciding which join method to choose, the optimizer balances the sort cost and the performance benefit for the inner table scan to drive the decision.
因此,在决定选择哪种联接方法时,优化器为内部表扫描平衡排序成本和性能优势以便促进决策。
应用推荐