i using oracle sql. i'm new sql, have next problem. if sorting rows that: "order column1 asc, column 2 desc", when column1 has index, column2 doesn't. know cases when column1 value same in different rows appear rarely. have next question, how affect on performance? matter how many entries have same column1 value? understand, if have table each entry have different column1 value sorting applied column1, without causing performance problems, right?
index used access data, not directly sort/order by. database fetched set of data, sort according order clause.
so general answer on question no: there no impact on sort performance
in cases, set can pre-sorted (due fetch order instance single index range scan return rows sorted key). in case, there no need sorting, , oracle show nosort in sql execution plan.
Comments
Post a Comment