pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: tv@fuzzy.cz
To: raghu ram <raghuchennuru@gmail.com>
Cc: Raghavendra <raghavendra.rao@enterprisedb.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Cc: pgsql novice <pgsql-novice@postgresql.org>
Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ?
Date: Tue, 3 May 2011 15:53:27 +0200
Message-ID: <6a9c2326b29433bde0de5c8a887d65be.squirrel@sq.gransy.com> (raw)
In-Reply-To: <BANLkTinmZhDFg-PV5sztAYVLMm7Qm-+p7w@mail.gmail.com>
References: <BANLkTikKE-iZQ3u_Voevgr2EpPFYjb2yng@mail.gmail.com>
<BANLkTikUYxYXUv-FsDQtN0CYiqkJ1BorXw@mail.gmail.com>
<BANLkTi=VtowCtuQTmjmnTiEk7mYAY8X2dw@mail.gmail.com>
<BANLkTinmZhDFg-PV5sztAYVLMm7Qm-+p7w@mail.gmail.com>
> On Tue, May 3, 2011 at 6:01 PM, Raghavendra <
> raghavendra.rao@enterprisedb.com> wrote:
>
>>
>> On Tue, May 3, 2011 at 5:37 PM, Simon Riggs <simon@2ndquadrant.com>
>> wrote:
>>
>>> On Tue, May 3, 2011 at 11:54 AM, raghu ram <raghuchennuru@gmail.com>
>>> wrote:
>>>
>>> > It may be a silly question, still out of curiosity I want to know, is
>>> there
>>> > any possible way to flush the Postgres Shared Memory without
>>> restarting
>>> the
>>> > cluster.
>>> > In Oracle, we can flush the SGA, can we get the same feature here..
>>> > Thanks in Advance.
>>>
>>>
>>> The CHECKPOINT command will do this for you.
>>>
>>
>>
>>
> According to PostgreSQL documentation, whenever you execute "CHECKPOINT"
> in
> the database,it will flush the modified data files presented in the Shared
> Buffers retuned to the Disk.
>
> http://www.postgresql.org/docs/9.0/static/sql-checkpoint.html
>
> Is this clears the entire shared memory cache and same time,if i execute
> fresh SQL statement, Data will be retuned from disk??
No. Checkpoint means all dirty buffers are written to the datafiles, it
does not mean emptying the shared buffers. Checkpoints happen regularly so
this would have an unwanted impact on performance.
And besides that, there's a page cache maintained by the OS (not sure if
you're running Linux or Windows). So even when the block does not exist in
the shared buffers, it may be in the page cache (thus not read from the
drive).
Dropping the page cache is quite simple (http://linux-mm.org/Drop_Caches),
emptying the shared buffers is not that simple - I guess the easiest way
is to restart the db.
What are you trying to achieve? Why do you need this?
Tomas
view thread (18+ messages) latest in thread
Message-ID: <6a9c2326b29433bde0de5c8a887d65be.squirrel@sq.gransy.com> Permalink: ../6a9c2326b29433bde0de5c8a887d65be.squirrel@sq.gransy.com/ Also on: postgresql.org/message-id/6a9c2326b29433bde0de5c8a887d65be.squirrel@sq.gransy.com ·
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 using the --to and --cc options: reply via email To: pgsql-admin@postgresql.org Cc: tv@fuzzy.cz, raghuchennuru@gmail.com, raghavendra.rao@enterprisedb.com, simon@2ndquadrant.com, pgsql-general@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ? In-Reply-To: <6a9c2326b29433bde0de5c8a887d65be.squirrel@sq.gransy.com> * 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