Hi

I wonder if it's possible to change the sort order of the keys in an index?

By manually recreating the index, but with the key as desc instead of asc, I save myself from sorting a couple of thousands of rows, and makes an improvement of nearly 400% CPU usage, and 200% time usage. However, manually recreating indexes whenever I want to upgrade the scheme isn't feasible

asked Oct 05 '12 at 23:20

Onkelborg's gravatar image

Onkelborg
677712


One Answer:

I've found it, thanks to dotPeek :) Adding :ASC och :DESC to the key name in the IndexAttribute enforces a particular direction :)

Sometimes, when all hope is gone, a good reflection tool will save the day.. ;)

answered Oct 05 '12 at 23:46

Onkelborg's gravatar image

Onkelborg
677712

Yep, it's correct way to do it.

(Oct 06 '12 at 02:19) Denis Krjuchkov Denis%20Krjuchkov's gravatar image
1

I guess, developers don't like to read product documentation. However, it exists on help.dataobjects.net and sometimes even contains answers to questions.

(Oct 06 '12 at 04:58) Dmitri Maximov Dmitri%20Maximov's gravatar image
1

Haha, I've started with the docs, then google, and then searching the forums.. I guess I missed, maybe since I was determined I was looking for some property or similar :P

(Oct 06 '12 at 09:26) Onkelborg Onkelborg's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA