0

I have a small doubt on indexing for a column in a table. Already I have an index for a date column with the order ASC. Is it good to have another index with the order DESC? Will it work fine? Thanks in advance.

2
  • In general, no. But that could depend on the database. Commented Jun 29, 2018 at 1:55
  • @KenWhite I can do ORDER BY DESC for the particular column but already I have an index with ASC for the column so, I have quite confused whether this will give impact in my query performance. And one more thing for another process I have used the index with ASC. Now I need the same column to search with ORDER BY DESC. Commented Jun 29, 2018 at 1:59

1 Answer 1

1

It will work, but there is no benefit at all to doing so. An index can be read in both directions, so it does not help you at all. Every index has costs, both in hard drive space and the processing power and time it takes to keep it up to date when adding/changing records, so adding indexes that are not needed is actually a disadvantage.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.