Mysql到SQL Server:有没有类似查询缓存的东西?

发布于 2024-09-25 04:55:17 字数 138 浏览 0 评论 0原文

我正在尝试优化 SQL Server。我对 Mysql 有一些经验,通常有帮助的事情之一是启用查询缓存,只要您运行相同的查询,它基本上就会缓存查询结果。

SQL Server 上有类似的东西吗?您能指出这个功能的名称吗?

谢谢!

I'm trying to optimize a SQL Server. I have some experience with Mysql and one of the things that usually help is to enable query cache, that will basically cache query results as long as you are running the same query.

Is there something similar to this on SQL Server? Could you please point what is the name of this feature?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纵性 2024-10-02 04:55:17

SQL Server本身并不缓存结果集,但除了缓存查询执行计划之外,它还会缓存已读取的数据页。这意味着,如果它必须再次读取相同的数据页来回答查询,那么速度会更快,因为(从磁盘)物理读取较少,但您仍然应该看到相同数量的逻辑读取。
这里有一篇文章,其中包含更多详细信息。

SQL Server doesn't cache result sets per se, but it does cache data pages which have been read, in addition to caching query execution plans. This means that if it has to read the same data pages again to answer a query, it will be faster since there are fewer physical reads (from disk) but you should still see the same amount of logical reads.
Here is an article with more details.

紫竹語嫣☆ 2024-10-02 04:55:17

SQL Server 将缓存查询结果,但它比 MySQL 的情况稍微复杂一些(因为 SQL Server 提供 ACID 保证,而 MySQL 不提供 - 至少 MyISAM 不提供)。但你肯定会发现,第二次在 SQL Server 上执行查询时,它会比第一次更快(只要没有发生其他更改)。

据我所知,此功能没有具体名称。它更像是缓存的组合......

SQL Server will cache query results, but it's a little more complicated than in MySQL's case (since SQL Server provides ACID guarantees that MySQL does not - at least, not with MyISAM). But you'll definitely find that the second time you execute a query on SQL Server, it'll be faster than the first time (as long as no other changes have happened).

There's no specific name for this feature, that I'm aware of. It's more a combination of caches...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文