title: Issue in SQL Server?
body: <p>I have 2 databases (v1, v7) with the same data structure and schema. Data on v7 larger than v1. When I run the the same SQL statement on v7 takes less than 1s
  v1 also took over 11s.</p>
  
  <p>My SQL statement:</p>
  
  <pre><code>SELECT 
      bs.[ID], bs.[TapeID], bs.[ChanelID], bs.[ContractID],
      bs.[ContractSectionID], bs.[Name], bs.[RegisterDate],
      bs.[ValidFrom], bs.[ValidToDate], bs.[GPRP], bs.[Status],
      bs.[Note], bs.[Code], bs.[JobCodeID], bs.[SpotCount],
      bs.[BookNumber], bs.[Adjusted], bs.[PrintedCNPS],
      bs.[UserID], bs.[CreateTime], bs.[ModifiedTime],
      '' + t.Code + ' - ' + t.Name, ch.Code, 
      '[' + c.Code + '] ' + cus.Name, cs.Code, 
      jb.Code, p.Name, us.UserName, cus.Code, t.Duration,
      (select count(*) from Spot 
       where Position in ('1','2','3','E','D','F') 
         and bs.ID = Spot.BookScheudlerID 
         and Status not in (2,3,5)) as SpotUuTien, --mục địch tạo ra column
      (select count(*) from Spot 
       where Position in ('A') and Pending = 1 
         and bs.ID = Spot.BookScheudlerID 
         and Status not in (2, 3, 5)) as SpotUuTienFree, /*mục địch tạo ra column*/ 
  FROM 
      [BookScheduler] bs 
  INNER JOIN
      Tape t on bs.TapeID = t.ID
  INNER JOIN
      Contract c on bs.ContractID = c.ID
  INNER JOIN
      ContractSection cs on bs.ContractSectionID = cs.ID
  LEFT JOIN 
      JobCode jb on bs.JobCodeID = jb.ID
  INNER JOIN
      Product p on t.ProductID = p.ID
  INNER JOIN
      Chanel ch on bs.ChanelID = ch.ID
  INNER JOIN
      Customer cus on c.CustomerID = cus.ID
  LEFT JOIN 
      AppUser us on bs.UserID = us.ID 
  WHERE 
      bs.ValidFrom &gt;= '05/01/2015 00:00:00' 
      AND bs.ValidToDate &lt;= '05/30/2015 00:00:00'
  </code></pre>
  
  <p>I think the problem index on v1 should I rebuild its index. Then run the sql statement above, but the results did not change.</p>
  
  <p>Then I created a new database have the same structured with v1 and I moved data from v1 to the new database, when I run the SQL statement on the new database very fast speed (like on v7).</p>
  
  <p>So let me ask my v1 being what? and how to improve the speed to it without creating a new database?</p>