問題文
A call center relies on a list view that selects accounts by region and then sorts the result by city. The object holds three million rows, the region value in use covers a small share of them, and the view takes a long time to render. Which indexing approach suits this list view?
選択肢
- Two separate single-column indexes, one on each field, because the optimizer combines two single-column indexes into one access path and the order in which the fields are listed therefore makes no difference to how the rows are selected and then sorted.
- A two-column index with the sorting field in the first column, so that the rows arrive already ordered before the selection narrows them down, which spares the platform a separate sort over the three million rows.
- A two-column custom index that places the selecting field in the first column and the sorting field in the second column.
- A single index on the sorting field, because the sorting is the slow part of the view, and the region filter is cheap by comparison.