pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: bricklen <bricklen@gmail.com>
Cc: hmidi slim <hmidi.slim2@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: How clear the cache on postgresql?
Date: Fri, 24 Nov 2017 11:55:52 -0500
Message-ID: <29149.1511542552@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGrpgQ9eBOiVNF-LGCzN_E6FgErjBQ5xsUi8TVcxvDh+jwqUqg@mail.gmail.com>
References: <CAMsqVxuUm-yEJJM6JeLx5bFRpeOERyvyxDScoAsKaZN84G2XEA@mail.gmail.com>
	<CAGrpgQ9eBOiVNF-LGCzN_E6FgErjBQ5xsUi8TVcxvDh+jwqUqg@mail.gmail.com>

bricklen <bricklen@gmail.com> writes:
> On Fri, Nov 24, 2017 at 6:54 AM, hmidi slim <hmidi.slim2@gmail.com> wrote:
>> I'm trying to analyze some queries using the explain instructions and the
>> option analyze and buffers. I realized that the query refers to the cache
>> memory to return the results. Is there any solution to clear the cache in
>> postgresql inorder to get execution time of the query when it get data from
>> disk and not from cache memory?

> If you are on a (non-production) *nix server you can use:
> sync && echo 3 > /proc/sys/vm/drop_caches​

You would also need to restart the postmaster, to get rid of whatever
is in Postgres' shared buffers.

			regards, tom lane




view thread (9+ messages)  latest in thread

Message-ID: <29149.1511542552@sss.pgh.pa.us>
Permalink:  ../29149.1511542552@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29149.1511542552@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bricklen@gmail.com, hmidi.slim2@gmail.com
  Subject: Re: How clear the cache on postgresql?
  In-Reply-To: <29149.1511542552@sss.pgh.pa.us>
  References: <CAMsqVxuUm-yEJJM6JeLx5bFRpeOERyvyxDScoAsKaZN84G2XEA@mail.gmail.com> <CAGrpgQ9eBOiVNF-LGCzN_E6FgErjBQ5xsUi8TVcxvDh+jwqUqg@mail.gmail.com> <29149.1511542552@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox