Does Postgres provide a command to flush buffer ca

2019-02-20 05:59发布

Hi Sometimes I need to do some SQL tuning task, I usually do such tests on my test db. After I excute a sql statments, I want to flush the buffer cache which containing SQL statements and sql result, just like the command in Oracle "Alter system flush buffer_cache"
Is PG server provide a commond of this?

2条回答
啃猪蹄的小仙女
2楼-- · 2019-02-20 06:12

If you're developing on OSX (I haven't tested on linux), you can use purge command to force disk cache to be purged (flushed and emptied). Then run your SQL query again and it should execute as if it were the first time.

查看更多
别忘想泡老子
3楼-- · 2019-02-20 06:22
登录 后发表回答