Re: How i can empty the buffers of a db

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tourtounis Sotiris <tourtoun(at)csd(dot)uoc(dot)gr>, Josh Jore <josh(at)greentechnologist(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How i can empty the buffers of a db
Date: 2002-08-02 19:54:09
Message-ID: Pine.LNX.4.44.0208021352040.1360-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2 Aug 2002, Tom Lane wrote:

> Tourtounis Sotiris <tourtoun(at)csd(dot)uoc(dot)gr> writes:
> > I am sorry for my lack of good knowledge of English but i have previously
> > asked how during a session with the database server to empty the memory
> > buffers after any commited select/insert/delete in order to have an as
> > much as possible indicative execution time and explain facility for each
> > of them. Thank you for your willingness of help !!!
>
> Ah. In that case Josh's guess was right: you want to reboot the machine
> for each query. That's the only way AFAIK to flush the kernel's disk
> caches. Since Postgres relies on the kernel's disk buffering quite as
> much as its own buffering, just flushing Postgres' buffers wouldn't get
> you back to a standing start anyway.
>
> But I'm not sure that you'd be proving a lot by running your tests that
> way --- it's not got a lot to do with realistic usage conditions. The
> normal state of affairs for a database under load is that there is lots
> of stuff in disk cache.

Nah, just write something that allocates enough memory to make the kernel
give up it's disk cache, then give it right back. Don't do this on
production machines (I don't really need to add that do I? :-)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-08-02 19:54:42 Re: custom type similar to varchar(#)
Previous Message Tom Lane 2002-08-02 19:40:12 Re: b1 OR b2 <-> ( CASE WHEN b1 THE true ELSE b2 END ): performance bottleneck on logical OR