为什么第二次运行时相同的查询运行得更快? [英] Why does the same query run faster the second time I run it?

查看:133
本文介绍了为什么第二次运行时相同的查询运行得更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







当我第二次运行SQL查询时,它比第一次运行更快。如何加快第一次运行?

Hi,


When i run a sql query second time, it works faster than first run. How speed up the first run?

推荐答案

您所遇到的内容称为缓存。数据库不必第二次进入磁盘,因为它可以从自己的缓冲区缓存中获取数据,或者操作系统/磁盘阵列也可以从自己的缓存中更快地提供数据。
What you are experiencing is called caching. The database doesn't have to go to disk the 2nd time because it can either get the data from its own buffer cache, or the operating system/disk array can also provide the data faster from its own cache.


这篇关于为什么第二次运行时相同的查询运行得更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆