gotchasqlMinor
why does my clustered index scan have ordered = false
Viewed 0 times
clusteredwhyscanfalsedoesindexhaveordered
Problem
When I look to at my query plan, I see plenty of clustered index seeks (yay!) and scans (not quite so yay!) but in some of them ordered = False. I will mention that we have parallelism involved, though it does not appear to have any relation to these. The indexes were set up with ordering.
What does this mean? That the query plan is ignoring this order? Or that the query is choosing not to order? Or... heck, I have no idea what I'm looking at...!
What does this mean? That the query plan is ignoring this order? Or that the query is choosing not to order? Or... heck, I have no idea what I'm looking at...!
Solution
It just means that the query optimiser doesn't require an explicit order guarantee either for some later operator in the plan (e.g. merge join or stream aggregate) or to avoid a sort because you have explicitly requested an
When
order by.When
ordered = false you might in some circumstances get an allocation ordered scan rather than a scan that follows the linked list of the leaf pages in index key order for example.Context
StackExchange Database Administrators Q#14909, answer score: 7
Revisions (0)
No revisions yet.