title: SQL Server 2005 "Pin" data in Memory
body: <p>We're running our application's database on dedicated box running only SQL Server 2005. 
  This DB server has 32 Gb of RAM... and the database file itself is only 6 Gb.</p>
  
  <p>I'd like to force several of the heavily read/queried tables into the SQL Memory buffer to increase speed.</p>
  
  <p>I understand that SQL server is really good about keeping necessary data cached in memory once it's read from disk... But our clients would probably prefer their query running quickly the FIRST time.
  "Fastest Performance the <em>Second</em> Time" isn't exactly a product highlight.</p>
  
  <p>Short of the old "Pin Table" DBCC command.. any thoughts?</p>
  
  <p>I've written a "CacheTableToSQLMemory" Proc which Loops through all of a table's Indexes (Clustered &amp; Non) , performing a "Select *" into a Temp table.  I've scheduled SQL Agent to run a "cache lots of tables" Proc every 15 minutes in an attempt to keep pages in Memory.</p>
  
  <p>It works to a large extent.. but even after I cache all of a query's relevant tables, running a query still increased the Count of Cached pages for that table. then it's faster the 2nd time. 
  thoughts?</p>
  
  <p>We're running PAE &amp; AWE. SQL is set to use between 8 &amp; 20 GB of RAM.</p>