Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Can we Flush the Postgres Shared Memory ?

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: raghu ram <raghuchennuru(at)gmail(dot)com>, Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ?
Date: 2011-05-03 13:55:00
Message-ID: BANLkTi=DbF3=sU=ki3yTGH9Y=ZVK7tH5yA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-novice
2011/5/3 Merlin Moncure <mmoncure(at)gmail(dot)com>:
> On Tue, May 3, 2011 at 8:30 AM, raghu ram <raghuchennuru(at)gmail(dot)com> wrote:
>> On Tue, May 3, 2011 at 6:01 PM, Raghavendra
>> <raghavendra(dot)rao(at)enterprisedb(dot)com> wrote:
>>>
>>> On Tue, May 3, 2011 at 5:37 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>>>
>>>> On Tue, May 3, 2011 at 11:54 AM, raghu ram <raghuchennuru(at)gmail(dot)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 it will not, or at least there is no guarantee it will be.  the
> only way to reset the buffers in that sense is to restart the database
> (and even then they might not be read from disk, because they could
> sit in the o/s cache).  to force a read from the drive you'd have to
> reboot the server, or at least shut it down and use a lot of memory
> for some other purpose.

with linux, you can : "echo 3 > /proc/sys/vm/drop_caches" for the OS cache

>
> merlin
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>



-- 
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

In response to

Responses

pgsql-novice by date

Next:From: Merlin MoncureDate: 2011-05-03 14:08:35
Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ?
Previous:From: Simon RiggsDate: 2011-05-03 13:54:30
Subject: Re: Can we Flush the Postgres Shared Memory ?

pgsql-admin by date

Next:From: Merlin MoncureDate: 2011-05-03 14:08:35
Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ?
Previous:From: Simon RiggsDate: 2011-05-03 13:54:30
Subject: Re: Can we Flush the Postgres Shared Memory ?

pgsql-general by date

Next:From: Merlin MoncureDate: 2011-05-03 14:08:35
Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ?
Previous:From: Simon RiggsDate: 2011-05-03 13:54:30
Subject: Re: Can we Flush the Postgres Shared Memory ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group