title: Why does SQL Server work faster when you index a table after filling it?
body: <p>I have a sproc that puts 750K records into a temp table through a query as one of its first actions.  If I create indexes on the temp table before filling it, the item takes about twice as long to run compared to when I index after filling the table.  (The index is an integer in a single column, the table being indexed is just two columns each a single integer.)</p>
  
  <p>This seems a little off to me, but then I don't have the firmest understanding of what goes on under the hood.  Does anyone have an answer for this? </p>