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 1thdaP-0051d1-54 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Feb 2025 23:53:09 +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 1thdaN-005lH3-Sx for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Feb 2025 23:53:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1thdaM-005lGm-Vn for pgsql-hackers@lists.postgresql.org; Mon, 10 Feb 2025 23:53:07 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thdaK-0007M9-2Y for pgsql-hackers@postgresql.org; Mon, 10 Feb 2025 23:53:05 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id A4F3D11400DD; Mon, 10 Feb 2025 18:53:03 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Mon, 10 Feb 2025 18:53:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1739231583; x=1739317983; bh=Hlto0Tfe2FTqdo8o+KpZSickRYXOQhtl4gp9jqYEPAc=; b= Gr2y7jnAtN/5VWRoxMGHpfGsMWg9eeDMTHFVZj2sZDLdEfecNb/Rq/cNMWXlzX+H uBMnU4Ugxty0wNOs9jTnpVtXCel0bGMIPiXoT7JLAaMHpvPz4cVMtmQwbwetJhzM OV57wvYs5XSZZZyjNwvtiyR2XTwEIUaOSHD7eM73rOvdD3sbt1tKysEdJSnkhRYk VJyYxkFu1yxVZ56yTtj+84yV0qJYoE5tY5W4yeuORMYbBF7I4tP1kJFYgYnbZmVb uc1L5vCVh/S8vmeaV3GOx6vH52yTeSBbzsQIoe7j7q+GefmeodRRJ1QQkZicv0xs Gj1O/7yAxHYOQGBhgwfSWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1739231583; x= 1739317983; bh=Hlto0Tfe2FTqdo8o+KpZSickRYXOQhtl4gp9jqYEPAc=; b=i GDj02VrWO0Buc7teJhrxkCjKQa5DlHWkxePK/GYJ8ajaZQr4kXX2Fhz1NgTip1ja 7SjdAO9JSLCEnbUTe1+jFsVCG9QCfpcaWUi3ccHEHYzJqR7u1tVSy/I+oOy086Us b9/fomhh+HHUXxkH0X3BS7LMbQzlwF8rcfB6R+0xGuBdmf5JZ+Woihq4LHcILWAk ksot1Z00oMg9eynNvUv9GtEJ5o39/B47zXIuWUZwg/GJqU8OnzNZTg7wlcVecYJ9 3eP4m057mXMRw/4mMdZj9hES9DBMXEXaZRRHXTIsp6jgPsLTUalFXCryxhezYuFm EjclFCWEYW0SeAG+IH5bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefleegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtugfgjgestheksfdttddt jeenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrg iivghlrdguvgeqnecuggftrfgrthhtvghrnheptdelledvgfejvdffieeukeefueelfffh geffhffgffekveeuheeihefhiefghfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggp rhgtphhtthhopeeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrjhhujhhuud dvfeesghhmrghilhdrtghomhdprhgtphhtthhopehpohhsthhgrhgvshesjhgvlhhtvghf rdhnlhdprhgtphhtthhopegsrhhutggvsehmohhmjhhirghnrdhushdprhgtphhtthhope htohhrihhkohhshhhirgesohhsshdrnhhtthgurghtrgdrtghomhdprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhope htghhlsehsshhsrdhpghhhrdhprgdruhhs X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Feb 2025 18:53:02 -0500 (EST) Date: Mon, 10 Feb 2025 18:53:01 -0500 From: Andres Freund To: Jelte Fennema-Nio Cc: Tom Lane , torikoshia , pgsql-hackers@postgresql.org, rjuju123@gmail.com, Bruce Momjian Subject: Re: RFC: Allow EXPLAIN to Output Page Fault Information Message-ID: References: <2c9d6eaf26df17bec13bb03bf1e9bcbb@oss.nttdata.com> <2035079.1739124342@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2025-02-10 18:30:56 -0500, Andres Freund wrote: > On 2025-02-10 23:52:17 +0100, Jelte Fennema-Nio wrote: > > On Mon, 10 Feb 2025 at 14:31, Andres Freund wrote: > > > But this will also not work with AIO w/ Buffered IO. Which we hope to use much > > > more commonly. > > > > To be clear, here you mean worker based AIO right? Because it would > > work with io_uring based AIO, right? > > I mostly meant worker based AIO, yes. I haven't checked how accurately these > are kept for io_uring. I would hope they are... It does look like it is tracked. > > > If suddenly I have to reimplement something like this to work with worker > > > based IO, it'll certainly take longer to get to AIO. > > > > I totally understand. But in my opinion it would be completely fine to > > decide that these new IO stats are simply not available for worker > > based IO. Just like they're not available for Windows either with this > > patch. > > The thing is that you'd often get completely misleading stats. Some of the IO > will still be done by the backend itself, so there will be a non-zero > value. But it will be a significant undercount, because the asynchronously > executed IO won't be tracked (if worker mode is used). postgres[985394][1]=# SHOW io_method ; ┌───────────┐ │ io_method │ ├───────────┤ │ worker │ └───────────┘ (1 row) postgres[985394][1]=# EXPLAIN ANALYZE SELECT count(*) FROM manyrows ; ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ QUERY PLAN │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Aggregate (cost=17906.00..17906.01 rows=1 width=8) (actual time=199.494..199.494 rows=1 loops=1) │ │ Buffers: shared read=5406 │ │ I/O Timings: shared read=57.906 │ │ -> Seq Scan on manyrows (cost=0.00..15406.00 rows=1000000 width=0) (actual time=0.380..140.671 rows=1000000 loops=1) │ │ Buffers: shared read=5406 │ │ I/O Timings: shared read=57.906 │ │ Planning: │ │ Buffers: shared hit=41 read=12 │ │ Storage I/O: read=192 times write=0 times │ │ Planning Time: 1.869 ms │ │ Execution Time: 199.554 ms │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ postgres[1014152][1]=# SHOW io_method ; ┌───────────┐ │ io_method │ ├───────────┤ │ io_uring │ └───────────┘ (1 row) postgres[1014152][1]=# EXPLAIN ANALYZE SELECT count(*) FROM manyrows ; ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ QUERY PLAN │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ Aggregate (cost=17906.00..17906.01 rows=1 width=8) (actual time=111.591..111.593 rows=1 loops=1) │ │ Buffers: shared read=5406 │ │ I/O Timings: shared read=14.342 │ │ -> Seq Scan on manyrows (cost=0.00..15406.00 rows=1000000 width=0) (actual time=0.161..70.843 rows=1000000 loops=1) │ │ Buffers: shared read=5406 │ │ I/O Timings: shared read=14.342 │ │ Planning: │ │ Buffers: shared hit=41 read=12 │ │ Storage I/O: read=192 times write=0 times │ │ Planning Time: 1.768 ms │ │ Execution: │ │ Storage I/O: read=86496 times write=0 times │ │ Execution Time: 111.670 ms │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Independent to of this, it's probably not good that we're tracking shared buffer hits after io combining, if I interpret this correctly... That looks to be an issue in master, not just the AIO branch. Greetings, Andres Freund