Re: Pinning a table into memory - Mailing list pgsql-general

From Tom Lane
Subject Re: Pinning a table into memory
Date
Msg-id 25545.1033757267@sss.pgh.pa.us
Whole thread Raw
In response to Pinning a table into memory  ("David Blood" <david@matraex.com>)
List pgsql-general
"David Blood" <david@matraex.com> writes:
> In Oracle you can Pin large objects into memory to prevent frequent
> reloads. Is there anyway to do this with Postgres?

I can never understand why people think this would be a good idea.
If you're hitting a table frequently, it will stay in memory anyway
(either in Postgres shared buffers or kernel disk cache).  If you're
not hitting it frequently enough to keep it swapped in, then whatever
is getting swapped in instead is probably a better candidate to be
occupying the space.  ISTM that a manual "pin this table" knob would
mostly have the effect of making performance worse, whenever the
system activity is slightly different from the situation you had in
mind when you installed the pin.

Having said that, I'll freely concede that our cache management
algorithms could use improvement (and there are people looking at
that right now).  But a manual pin doesn't seem like a better answer.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: DTOI4 integer out of range
Next
From: Bruce Momjian
Date:
Subject: Re: DTOI4 integer out of range