SQL Hint to load an entire table into RAM before executing it?

I am running some aggregate queries on some very large tables in an OLAP environment. Currently, I am limited to a narrow IO drive at 200 MB / s.

I am making these requests on a machine with 92 GB of RAM. Are there any SQL hints that I can write to my query, which basically tells SQL, to load the entire table into RAM before it executes?

Sort of:

select * from myTable with (ramdisk)

I am using MS TSQL.

+6
source share
1 answer

No. The database engine will do this automatically if it has enough space in the page cache.

You can set the amount of memory used by SQL Server Management Studio. Right-click on the server, select the memory option and place a large amount in the "Minimum server memory" field. If you have 92 GB of RAM, then a number like 85,000, for example, is probably good. You need to leave additional memory for the operating system and other services on the computer.

Assuming that the table (s) fit in memory, this should facilitate processing. If they do not fit into memory, you may need a different approach.

+2
source

All Articles