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 1urm1q-00CE87-Gg for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 23:27:40 +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 1urm1p-005HlH-Kg for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 23:27:38 +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 1urm1o-005Hl7-JP for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 23:27:37 +0000 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1urm1m-002GXt-26 for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 23:27:36 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id B61E41D00101; Thu, 28 Aug 2025 19:27:33 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Thu, 28 Aug 2025 19:27:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc: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=fm1; t=1756423653; x=1756510053; bh=XFL0wrnbiT SJs3pFO4Tt6qnkpx2MeZLd+nOqeWBmGZ8=; b=E3YdH56fTSrTBEVq3IIxq98+v3 NMfWrM7XBvcm/WGQigTRJW7QGPQXz1oo0sPkvn5RfZIYiBUKs4T7ophvhzc58Ypq j8BLp6k4L12UFLfAUFyuaa5rnjMEf94z+/hIJs31bSSTidFX9XEXQYTBV6L7HIwZ B16v1naQEu00ld+WUxw5XFsHZfZYD2jBIF7NraPOkRBP9jkxidlRXXqHVRcvuPZe ZYAey7ZX3/doih/Psb/k2BNXCbsRcFcXJdDmtfgLyU8yJkRk60kEx3nwAgv7h1Sk GHDsQm2ngQRlwMa+jnEHnXeV1oSG87MJMpgEXARu0yR45HK+3CqngxzIoP0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=fm1; t= 1756423653; x=1756510053; bh=XFL0wrnbiTSJs3pFO4Tt6qnkpx2MeZLd+nO qeWBmGZ8=; b=Ns0/ksIP2W781j1DUDB3Zh8W494Ic96pF+64zJhlYf+WdXDsX78 8GOoAymKTcdVjc7UDecDmq/X7N43GH29Y6JOQ5jGoEu+Z1B8IJlSAmJmdgopdL8B v1bJfYd2LpXAcq0yaDaGFOe5Bt+N0BR7Cc6NTimYAp+IyXYhPq12NmgUB1aypWB/ 7jfG8AxrRM8niLLx5sls5/N28ihJ+fqSUDcFO1MGS12S9KgVUuEa54FfTcL2sIy7 yymPg1DO5yMVJZkqsekeE5btHflr2VT7Sm6xtQIIS5CAQiyjPhkv89eSwz1eFM24 X6HakIHPiVosPzcZYHx8RzhuybO/y0aaCVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddukedvfedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepgedtveeifeehjeefveelgeehgeeigeffiefhgfekleethfehueekueefleeg uddunecuffhomhgrihhnpehpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv pdhnsggprhgtphhtthhopedutddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepph hgsegsohifthdrihgvpdhrtghpthhtohepkhhnihiihhhnihhksehgrghrrhgvthdrrhhu pdhrtghpthhtohepsgihrghvuhiikedusehgmhgrihhlrdgtohhmpdhrtghpthhtohepug hilhhiphgsrghlrghuthesghhmrghilhdrtghomhdprhgtphhtthhopehmvghlrghnihgv phhlrghgvghmrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhosggvrhhtmhhhrg grshesghhmrghilhdrtghomhdprhgtphhtthhopehthhhomhgrshdrmhhunhhrohesghhm rghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrd hpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehgkhhokhholhgrthhoshesphhr ohhtohhnmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Aug 2025 19:27:32 -0400 (EDT) Date: Thu, 28 Aug 2025 19:27:32 -0400 From: Andres Freund To: Tomas Vondra Cc: Thomas Munro , Peter Geoghegan , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar Subject: Re: index prefetching Message-ID: References: <6butbqln6ewi5kuxz3kfv2mwomnlgtate4mb4lpa7gb2l63j4t@stlwbi2dvvev> <0dd33755-cab8-49c8-b1ed-698732577fbb@vondra.me> <1c9302da-c834-4773-a527-1c1a7029c5a3@vondra.me> <6d59c277-c440-4d1f-a46e-157958c06a5f@vondra.me> <5pltwb73d7cynsxo2yb54ygjk7haviatkrx43mnzihc6kkield@ahnstpgof46i> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2025-08-29 01:00:58 +0200, Tomas Vondra wrote: > I'm not sure how to determine what concurrency it "wants". All I know is > that for "warm" runs [1], the basic index prefetch patch uses distance > ~2.0 on average, and is ~2x slower than master. And with the patches the > distance is ~270, and it's 30% slower than master. (IIRC there's about > 30% misses, so 270 is fairly high. Can't check now, the machine is > running other tests.) There got to be something wrong here, I don't see a reason why at any meaningful distance it'd be slower. What set of patches do I need to repro the issue? And what are the complete set of pieces to load the data? https://postgr.es/m/293a4735-79a4-499c-9a36-870ee9286281%40vondra.me has the query, but afaict not enough information to infer init.sql > Not sure about wait events, but I don't think any backends are doing > sychnronous I/O. There's only that one query running, and it's using AIO > (except for the index, which is still read synchronously). > > Likewise, I don't think there's insufficient number of workers. I've > tried with 3 and 12 workers, and there's virtually no difference between > those. IIRC when watching "top", I've never seen more than 1 or maybe 2 > workers active (using CPU). That doesn't say much - if the they are doing IO, they're not on CPU... Greetings, Andres Freund