Is it usefull to have an ascending and a descending index on the same column? |
No, there is no need to define both an ascending column index and a descending index on the column. One or the other is sufficient and the SQL Anywhere server will perform a reverse index scan in cases that it makes sense to do so. |
Just to add to Mark's sound answer (though Martin seems to refer to a single-column index): The situation would be different if the index is a composite one (i.e. is built over 2 or more columns). Then not only the columns's order in the index (colA, colB vs. colB, colA), but also their according sort order will make a difference (colA ASC, colB ASC vs. colA ASC, colB DESC). Cf. the docs. |