title: Is ORDER BY supposed to positively affect cursor performance and why?
body: <p>I have a script that looks like this (<code>Id1</code> and <code>Id2</code> compose the table primiary key)</p>
  
  <pre><code>DECLARE @Id1 AS int,
          @Id2 AS smallint;
  
  DECLARE c CURSOR FAST_FORWARD FOR SELECT Id1, Id2 FROM dbo.someTable ORDER BY Id1, Id2
  OPEN c
      FETCH NEXT FROM c INTO @Id1, @Id2
      WHILE @@FETCH_STATUS = 0
          BEGIN
              --Do stuff that do not depend on row order (getting random values and updating some of the fields)
              FETCH NEXT FROM c INTO @Id1, @Id2
          END   
  CLOSE c
  DEALLOCATE c
  </code></pre>
  
  <p>With the <code>ORDER BY Id1, Id2</code> clause it runs much faster than without it.</p>
  
  <p>I expected that ordering the records would result some time waste, not time gain.</p>
  
  <p>I have other similar scripts on other tables that gain less speed from similar <code>ORDER BY</code> clause.</p>
  
  <p>So I'm wondering why I this <code>ORDER BY</code> clause can speed up a cursor, yet not all cursors.</p>