Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUjtC-002Hn2-QC for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 09:59:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tUjtC-007EmX-AD for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 09:59:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUjtC-007EmE-19 for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 09:59:13 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tUjt8-0008zS-3C for pgsql-hackers@postgresql.org; Mon, 06 Jan 2025 09:59:13 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ee8e8e29f6so16426350a91.0 for ; Mon, 06 Jan 2025 01:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736157549; x=1736762349; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BNEYYWTkOPuwaTM7tDO8M8se4WTqgSF4yGp7+hFwRC4=; b=X1KBzGwOUUmMdPst0LZcKTYNEdk7fACpOkG8mTYlaWo6dH68D7zJX9lEplxicmg580 4xBvHlaDeEe2H7EzIMRroGkzLyy9PrTrI2/bcf7dd5N7iQPhkQIbJqk4KwsY/xARhEK0 FYATkSqYBlKSuoK9uACiRm3HsMIj+v9vBsXZLBdmYIGhH2OgPP5EuDCuelHvV7j7bvLg ibyBtNRESE+w27bjSKIVX9Qd+6bLL5L9sByfc6Y9+XjFI0HH8kDjnC77L9AMex8yi6og eYglilPx3vubfC/0SHvH4oIvflm7aDMLOr3nexzcSnEiWh6JqQkUBG1/jy56SkGW/EHW s9PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736157549; x=1736762349; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BNEYYWTkOPuwaTM7tDO8M8se4WTqgSF4yGp7+hFwRC4=; b=m9rLYsl8oXsq0K6NHheoAxd4OmIDmhqFEmTioAV8OQcTM7GWRb5kdH08V9kzbMIRdj L81slCsK8MSUGXLioWOpRbXtavMridZiWyynMOx7+7Hny3zL/opJJDac4oFqXo3spnIg psYq8hQAvNmuaf+D+xp4PYN3B0whk86Fy5hVtkInEjWUIXu8lYpcWPXhs/qoc7hBVcRa 4mJ71BFJITQ5UrH2s/bi5EARNAOWzizq6bU2dZl6PNc8zTeehNurMfQjfB7I1xFgsSRd cK1/aOR3IHJLo2tBrbibvA72yUFQlBt1QRx55Suk7vbh1wdo2M0GrzXrS6P5BGpQMlN1 +qxg== X-Forwarded-Encrypted: i=1; AJvYcCWWRA2La7SgBmFrypR4oD7dULP4gp0PKkL2m9fw/E0gLM0N7GzT01NDgaEwaCK1sAPwmBSvvTyc0zovP8xL@postgresql.org X-Gm-Message-State: AOJu0YzyJEuFBurwQ1lUV3M3OaTCN5YjWevS3us8YLuQqQ6BOZn3zS4Z iKgTbBlMurBayEtj0NG4zhhdskfqCRItQQVsIvJyxNpS705cQy7W X-Gm-Gg: ASbGnctAWj++HusVACjJQpi4nHd53jsKyaB17RiTETuSpyz/2wkVUfS3U3SvzRoLWIf C+CIdxSebwWkON96CR1KsXLyO13gspbA4X+9vCApExzusVPH5ODrYJFU8umO7xKI65FUWh75LgT Gfra7deCefqg3A8BMAmdn6zRmGOBjWAk+lFhQT0ckVRr+fBj0heWQqcGaKQF4uQzudEMISyxQ6/ thvNo5QdvA90dJRxlTlOrRr3+uy3exYLzaYVucXdsHTpjkE X-Google-Smtp-Source: AGHT+IFRLODsg97+8otUqeLwhb+ovzYu/PPZr084CgQhk+U9nFaYPW9Ionon5uDewRp4Xe1On1kX1w== X-Received: by 2002:a17:90b:2c85:b0:2ee:90a1:5d42 with SMTP id 98e67ed59e1d1-2f452d2fc15mr100076466a91.0.1736157549509; Mon, 06 Jan 2025 01:59:09 -0800 (PST) Received: from jrouhaud ([115.43.41.38]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f4478a9108sm36983625a91.43.2025.01.06.01.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 01:59:08 -0800 (PST) Date: Mon, 6 Jan 2025 17:59:02 +0800 From: Julien Rouhaud To: torikoshia Cc: Jelte Fennema-Nio , tgl@sss.pgh.pa.us, Bruce Momjian , Pgsql Hackers Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information Message-ID: References: <1614321.1735055528@sss.pgh.pa.us> <3861403.1735576764@sss.pgh.pa.us> <1f22794321b745549d54359d343e37b8@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f22794321b745549d54359d343e37b8@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Jan 06, 2025 at 06:49:06PM +0900, torikoshia wrote: > > > **However, I think the general direction has merit**: Changing this > > patch to > > use `ru_inblock`/`ru_oublock` gives very useful insights. `ru_inblock` > > is 0 when everything is in page cache, and it is very high when stuff is > > not. I was only hacking around and basically did this: > > > > s/ru_minflt/ru_inblock/g > > s/ru_majflt/ru_oublock/g > > [...] > > Also, maybe there's some better way > > of getting read/write numbers for the current process than > > ru_inblock/ru_oublock (but this one seems to work at least reasonably > > well). > > Maybe, but as far as using getrusage(), ru_inblock and ru_outblock seem the > best. FWIW that's the counters we've been using in pg_stat_kcache / powa to compute disk IO and "postgres shared buffers hit VS OS cache hit VS disk read" hit ratio for many years and we didn't get any problem report for that.