Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpbMf-0000lU-Dx for pgsql-performance@arkaria.postgresql.org; Wed, 06 Sep 2017 14:31:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dpbMe-0001Bk-Cn for pgsql-performance@arkaria.postgresql.org; Wed, 06 Sep 2017 14:31:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dpbMd-0001A5-D5 for pgsql-performance@postgresql.org; Wed, 06 Sep 2017 14:31:35 +0000 Received: from mail.fmed.uba.ar ([157.92.152.1] helo=azteca.fmed.uba.ar) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpbMY-0001lB-9P for pgsql-performance@postgresql.org; Wed, 06 Sep 2017 14:31:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id CFDC137E104E; Wed, 6 Sep 2017 11:31:21 -0300 (ART) Received: from azteca.fmed.uba.ar ([127.0.0.1]) by localhost (azteca.fmed.uba.ar [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 6RYXE_g9fr_4; Wed, 6 Sep 2017 11:31:20 -0300 (ART) Received: from localhost (localhost.localdomain [127.0.0.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id 86B4F37E10EE; Wed, 6 Sep 2017 11:31:20 -0300 (ART) X-Virus-Scanned: amavisd-new at fmed.uba.ar Received: from azteca.fmed.uba.ar ([127.0.0.1]) by localhost (azteca.fmed.uba.ar [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eKF3DVBDeD-c; Wed, 6 Sep 2017 11:31:20 -0300 (ART) Received: from azteca.fmed.uba.ar (azteca.fmed.uba.ar [157.92.152.1]) by azteca.fmed.uba.ar (Postfix) with ESMTP id 4F2AB37E0EC6; Wed, 6 Sep 2017 11:13:34 -0300 (ART) Date: Wed, 6 Sep 2017 14:13:34 +0000 (UTC) From: Gerardo Herzig To: Soni M Cc: pgsql-performance@postgresql.org Message-ID: <1752296765.269917.1504707214219.JavaMail.zimbra@fmed.uba.ar> In-Reply-To: References: Subject: Re: OS cache management MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [157.92.152.69] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF52 (Linux)/8.0.9_GA_6191) Thread-Topic: OS cache management Thread-Index: CexCZhumP3IRe/Wc4IwtxFAkua+ngg== List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org ----- Mensaje original ----- > De: "Soni M" > Para: pgsql-performance@postgresql.org > Enviados: Mi=C3=A9rcoles, 6 de Septiembre 2017 5:12:26 > Asunto: [PERFORM] OS cache management >=20 > Hello All, I would like to know about how OS cache works for postgres tab= le > and index file. >=20 > Let's say I have 10 year data, and commonly used data only the last 1 yea= r. > This data is quite big, so each table and index file is divided into > several file in PGDATA/base >=20 > Let's say 1 index named order_by_date has relfilenode =3D 1870772348, and > it's file consist of 1870772348, 1870772348.1, and 1870772348.2 >=20 > And for oftenly queried 1 year data, do ALL files for the order_by_date > pushed to OS cache ? or it's just 1 file that contains index to this 1 ye= ar > data. >=20 Postgres has its own cache (defined by the "shared_buffers" variable). Usua= lly, the unit of movement in and out from the cache is a 8k page (defined a= t compilation time), so you cant put it directly in terms of files. There is an extension that can inspect the cache contents: https://www.postgresql.org/docs/current/static/pgbuffercache.html HTH Gerardo --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance