Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D51644762E0 for ; Fri, 4 Oct 2002 14:47:49 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 1D4394762E2 for ; Fri, 4 Oct 2002 14:47:49 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g94IllhR025546; Fri, 4 Oct 2002 14:47:48 -0400 (EDT) To: "David Blood" Cc: pgsql-general@postgresql.org Subject: Re: Pinning a table into memory In-reply-to: <03a301c26bc5$a799a970$1f00a8c0@redwood> References: <03a301c26bc5$a799a970$1f00a8c0@redwood> Comments: In-reply-to "David Blood" message dated "Fri, 04 Oct 2002 10:46:57 -0600" Date: Fri, 04 Oct 2002 14:47:47 -0400 Message-ID: <25545.1033757267@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/274 X-Sequence-Number: 31272 "David Blood" 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