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 1umdQI-001CdB-I0 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Aug 2025 19:15:38 +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 1umdQE-008zv3-H1 for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Aug 2025 19:15:34 +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 1umdQE-008zu5-3I for pgsql-hackers@lists.postgresql.org; Thu, 14 Aug 2025 19:15:34 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1umdQB-000axN-0b for pgsql-hackers@lists.postgresql.org; Thu, 14 Aug 2025 19:15:33 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3b9e40e27dcso1031576f8f.1 for ; Thu, 14 Aug 2025 12:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1755198929; x=1755803729; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6hu3Si9Z165dBvwTLVigT74YKunjUCWvhbDCRZuEmho=; b=O4tUChsFQxgyw/2kViCyD7t3Qt9Nr61quz11dOZXhhAP5kCEz1tEpbs8cHjCUHGEMO 3cAFXSnpd/Kr1E4m41VsQ9k3fEXkUv2OXfbxsAvwowXocPmTQ2wRRjqP4kGEku0HA7k/ eqNKYr/aGlh73nzlUvb4Gwo1cAOc3xiIFR/JzlA3nY/iKx/gL0QNyYJeMm+8tKAzp5Wg CAxKHSP8FyIf1Q7RW46BYNQcnF6NiADy5M22zje9Srtby9MV2R+qQmcEtJqhXtgbobQM DwS4Ppb/yjyIvGg4sgeooYmfOXRKsIPF0BN0KGg4/FaEhRGAD1H42F56JuHoh4bpmTaN hChw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755198929; x=1755803729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6hu3Si9Z165dBvwTLVigT74YKunjUCWvhbDCRZuEmho=; b=YUxPG/oZs1NxpoAOGMHzb0/9jQik9lJ6mPbnE2bS3GBTqM3wZT0nD+FNHtNSDPNbn+ jOlA+zB1S/J6zowaha68DrLK4rnoSK/A27eOokV36C6E+CU1Pvlnc7BHgfXElZ24dncL p6lLsqBkMn7CPIEDACP/5d0CtsAjRY82Ni0V68+vMC3uwV+CpSH+ujfy1oddt+yAtKmZ dt/KoT6Wm8iZaNS6ZpVhNi7iRZDr+H0a9giAhVubDrXCP4QuXLvNhak4BC9az6uhbw7j RYsi4qy7hxGXQzBRRXVxRo+wxsoMu84d8mOV73bya0EABsdbm1Wa0+N0IWNhfkeN87/T OCnQ== X-Forwarded-Encrypted: i=1; AJvYcCVk57FKCFqAdT8cqbc6oztb4UyCvruonc51KCOcDJ3I7g6v0PCigzOGDhXC1HLI0VqXJ1i/RhjYiZEp7IXf@lists.postgresql.org X-Gm-Message-State: AOJu0YxFLmBnVzzLX5UULHZNS5ZKpRyZR/a9UOW4/6vEwpWfiSkUlCpE qSPFFyAHibuMwZ3ywjExKHkndz01mNBQzZA6N4cG4OkqfTUbp6sXgyxHv4T0bWfTaEvOWjab7RU 6bGso8/7GLIEYhYbe965VU5MECRIQOk9fPJyZLY5otw== X-Gm-Gg: ASbGncvfceHK41yIIESXaM5pemTx+ixYowh5Ye5kLqrbOQpmSd0GP4y+c7zMq2lgrl9 8uoXAoF9YAxUqaSPtPFUzzckXr+ceVNP3yUXr73o78FsxFzSANwHlZsZzYyyo9ss1Urqa4qYdyi 0p6JtJKmGPxIwbUJRK+cLfM9SJSNC2gqInkrHw/4bMB7GuRLgGp/aU/peqUzRi/MLT0by8RQmxo OENyGsxKvqCWgfTrN0tr1geD6DS X-Google-Smtp-Source: AGHT+IG17BWmft5zzRegrSWYeg/eoM2Q+0plL3NLgTNs2xXGAcRorOK9MYHRejEuJ90nMLihTbnP4dVNoFE42B9YQmo= X-Received: by 2002:a05:6000:2085:b0:3b8:ff5e:f3cf with SMTP id ffacd0b85a97d-3b9edfc7fe4mr3505795f8f.32.1755198928866; Thu, 14 Aug 2025 12:15:28 -0700 (PDT) MIME-Version: 1.0 References: <6cb6109d-71d6-490c-8056-d8885081b008@vondra.me> <7c308720-5cd4-4508-8cc0-6e55a6352731@vondra.me> <6wyxbnry2unm3kbcu2sabhzhs7baoedlg77xqm42chpofjq45g@igst42zpl7ok> In-Reply-To: <6wyxbnry2unm3kbcu2sabhzhs7baoedlg77xqm42chpofjq45g@igst42zpl7ok> From: Peter Geoghegan Date: Thu, 14 Aug 2025 15:15:02 -0400 X-Gm-Features: Ac12FXyEvkdKOgyzTWnsaQDrVfHAkiaXyMmplLsgoERiSoey6u7uvZ3v5Mh9dk8 Message-ID: Subject: Re: index prefetching To: Andres Freund Cc: Tomas Vondra , Thomas Munro , Nazir Bilal Yavuz , Robert Haas , Melanie Plageman , PostgreSQL Hackers , Georgios , Konstantin Knizhnik , Dilip Kumar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Aug 14, 2025 at 2:53=E2=80=AFPM Andres Freund = wrote: > I think this is just an indicator of being IO bound. Then why does the exact same pair of runs show "I/O Timings: shared read=3D194.629" for the sequential table backwards scan (with total execution time 1132.360 ms), versus "I/O Timings: shared read=3D352.88" (with total execution time 697.681 ms) for the random table backwards scan? Obviously it is hard to believe that the query with shared read=3D194.629 is one that is naturally much more I/O bound than another similar query that shows shared read=3D352.88. What "I/O Timings" shows more or less makes sense to me already -- it just doesn't begin to explain why *overall query execution* is much slower when scanning backwards sequentially. > I'd see what changes if you temporarily reduce > /sys/block/nvme6n1/queue/max_sectors_kb to a smaller size. I reduced max_sectors_kb from 128 to 8. That had no significant effect. > Could you show iostat for both cases? iostat has lots of options. Can you be more specific? --=20 Peter Geoghegan