Re: [HACKERS] Postgres Performance - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: [HACKERS] Postgres Performance
Date
Msg-id 37CFF291.3B2FBBD2@alumni.caltech.edu
Whole thread Raw
In response to Re: University Masters Project  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Postgres Performance
List pgsql-hackers
> I have a couple of large(?) tables which I would like to keep them in
> memory (cached) so that searches are performed as fast as possible.
> Is it possible to 'pin' the tables and it's indexes in memory?

Not explicitly. We rely on the OS to do that.

> Are there any other options/values which would yield better performance?

By default, the backend "fsyncs" for every query. You can disable
this, which would then allow the tables to hang around in memory until
the OS decides to flush to disk. Not everyone should do this, since
there is a (small) risk that if your computer crashes after some
updates but before things are flushed then the db might become
inconsistant. afaik we have never had an unambiguous report that this
has actually happened (but others might remember differently). There
is already that risk to some extent, but instead of the window being
O(1sec) it becomes O(30sec).

Run the backend by adding '-o -F' (or just '-F' to your existing list
of "-o" options). 
                   - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


pgsql-hackers by date:

Previous
From: Edwin Ramirez
Date:
Subject: Postgres Performance
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Postgres Performance