Search Postgresql Archives

How to evaluate "explain analyze" correctly after "explain" for the same statement ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I just got a quick question about warm-cache. I'm using PG 9.2.

When I execute this statement soon after I start/restart the database:

explain select id from test where id = 124;

The runtime is 40ms.

Then, If I execute this statement just after the above one;

explain analyze select id from test where id = 124;

The runtime is 0.8ms.

Probably the statement is cached, right?


So, I do (To clear the cache):

  • service postgresql stop
  • echo 3 > /proc/sys/vm/drop_caches
  • service postgresql start
But, then, executing the statement again, it runs in 0.8 ms. 

How can I clean the cache to get the REAL runtime for that statement?
Thanks
Patrick


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux