Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 73F7713364DE; Tue, 3 May 2011 10:51:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 04287-03; Tue, 3 May 2011 13:51:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pv0-f174.google.com (mail-pv0-f174.google.com [74.125.83.174]) by mail.postgresql.org (Postfix) with ESMTP id 8A0331337B68; Tue, 3 May 2011 10:51:07 -0300 (ADT) Received: by pvg12 with SMTP id 12so35778pvg.19 for ; Tue, 03 May 2011 06:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=NPYDdIEuMtr5zI6dKm7ebkkRZRut3FRj5gkhz1nFipo=; b=iq7EurHsbieFtdWP9dhaheBVrs6RxXrdEfRMozZrtz5aKKvAU9BSYxFATIYJc9CvvN p34ykXA1UeCgYIlqHWMoxIhylODd3orVXEXqt1vsjmWOuDuUJZ4pXF7avmjST/qQCcPP BTaEIq+aR7Kerqa5wBYOolRCLFY4QjX/Uc9yU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Lm/X2F5ngHzA/kCFeBS3UqYmfzvybVOWqldMStzI+n1F4gbrvqwSrxpVh7mCYhAQAI kzkMInTmq8ayy3ZsbsYNXx/kyZUXG/IiKHfi4WRmLwGx2ZQQrI+xuzjqYlh+G0hka3C7 thiRKTgl2p7/e2XeW0IhLxWEJTuml5UNty154= MIME-Version: 1.0 Received: by 10.68.69.46 with SMTP id b14mr10366156pbu.41.1304430667885; Tue, 03 May 2011 06:51:07 -0700 (PDT) Received: by 10.68.62.129 with HTTP; Tue, 3 May 2011 06:51:07 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 May 2011 08:51:07 -0500 Message-ID: Subject: Re: [GENERAL] Can we Flush the Postgres Shared Memory ? From: Merlin Moncure To: raghu ram Cc: Raghavendra , Simon Riggs , pgsql-admin , pgsql-general , pgsql novice Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201105/22 X-Sequence-Number: 37459 On Tue, May 3, 2011 at 8:30 AM, raghu ram wrote: > On Tue, May 3, 2011 at 6:01 PM, Raghavendra > wrote: >> >> On Tue, May 3, 2011 at 5:37 PM, Simon Riggs wrot= e: >>> >>> On Tue, May 3, 2011 at 11:54 AM, raghu ram >>> 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 restarti= ng >>> > 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 Share= d > Buffers retuned to the Disk. > =A0 =A0 =A0 =A0 =A0 =A0http://www.postgresql.org/docs/9.0/static/sql-chec= kpoint.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. merlin