Disable Sql 2008 caching?

时间秒杀一切 提交于 2019-12-05 14:18:45

From your comments it sounds like you don't want SQL to use at much memory as you feel that it's pointless as any queries you run are effectively random.

Firstly, this memory is probably being used to store indexes and query plans, rather than the actual data you want returned, therefore you will probably find this cache is a lot more useful than you think.

Secondly, it is highly unlikely that sql using this amount of memory will cause any reduced performance on a truly random unseen query. If SQL Server needs to go to disk to get any information then the amount of memory its using is barely relevant.

However, it is possible to reduce the amount of memory that SQL Server uses. (I don't know where the option is in SQL 2008, but I assume its fairly similar) In Management Studio, right click on the Server and do Properties. Under there you will have a page for Memory. In here you can select the Minimum and Maximum values that SQL will use. This will effectively limit any caching sql does based upon your values, rather than the physical servers limitations.

I really don't think you will see any performance gains though. In my experience SQL is always best left doing it's own thing.

Your question is wrong: caching means data is in memory, and avoids disk access.

In any event, SQL Server caching is not harmful. For the pedants, there are always exceptions but you'd have to have seriously screwed up code and configuration before it was.

Turning off (or attempting to turn off) SQL Server caching is thinking about the problem completely the wrong way. If the data is cached in your data layer tier, you should refresh it there. SQL Server will never serve up stale data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!