2

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?

Daniel Kutik
  • 6,997
  • 2
  • 27
  • 34
francs
  • 8,511
  • 7
  • 39
  • 43
  • 2
    possible duplicate of [See and clear Postgres caches/buffers?](http://stackoverflow.com/questions/1216660/see-and-clear-postgres-caches-buffers) – Louis Apr 15 '15 at 19:03

1 Answers1

3

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.