load entire db in memory

  • Let's pretend 🙂

    I have a 10 GB data file. I have 20GB of memory. I don't care about locks blocks etc during the load, but I simply want to load the entire db into memory. If i write a script that one by one selects * from each table. When that scripts completes would not all pages now be loaded in memory. I know eventually they may expire, but again pretend nothing is adding memory pressure etc.

    If the above is correct, is there an easier way to say to SQL... "Load my db in memory"!

    Jimmy

    "I'm still learning the things i thought i knew!"
  • The "select *" might load all the data pages into memory, but the index pages might not all be there.

    An index rebuild on all tables would probably do the job, provided all tables have clustered indexes.

    Or you could just not worry about it and let SQL Server pull the data in as it needs it. Once it is there, it should stay there if there is no other need for the memory.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply