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.98.2) (envelope-from ) id 1xSLS8-00000001li4-1IcG for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Nov 2026 21:38:28 +0000 Received: from localhost ([127.0.0.1]:45032 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xSLS6-0000000EB7x-1TJu for pgsql-hackers@arkaria.postgresql.org; Sat, 14 Nov 2026 21:38:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:57668) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xSLOe-0000000E8rt-0WlS for pgsql-hackers@lists.postgresql.org; Sat, 14 Nov 2026 21:34:52 +0000 Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xSLOb-000000014Yk-37tz for pgsql-hackers@lists.postgresql.org; Sat, 14 Nov 2026 21:34:51 +0000 Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-5ee3a3d281fso1561338e0c.3 for ; Sat, 14 Nov 2026 13:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794692088; x=1795296888; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iArYD+TDa5VPvXfsrhsi2a2FPstD//xJHLWfQxP9G4I=; b=rVZczjYEnkzG0HcCOkICntQv/jDZC7PU0bGjFxnsVqqNF7jx9UPp+9AzLhVDCp0Ees Pw/eU7FLU/DHzL/nIq+WoKeeng1Egfrxvwj4J12uKELeCMztj37VFQONEmDwUBdNBbQI jkMig+ns9w8HuS78kLCR51devGIEKfVD5cgZEqPz03+Rtq1mddtnZKeEkjR67+v5ZJRF WT1vKov4tTJz8gvRvjCLMY7D6+VAvIxUpAaEPqX6IO9LzgtbFGtStj67s/P+4jlhf8Gz f97m7YvIDxcPHQEM1wd/LZEtMrOB+qeFzzfY0u8tAdpYVSMQG2b/93LiU3Rzsc8MKuhe LkjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794692088; x=1795296888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=iArYD+TDa5VPvXfsrhsi2a2FPstD//xJHLWfQxP9G4I=; b=AjFpYYaS5VTZCEJgTBcvGzf1yrBbeG7Y3OeILx3koWRPvJDKjVCg3MiYp00X4L5V9z 3hn2qctbZZM1s5KXai0dccYP9jKE6Iwrp4X0fAcotyBP608By5iyBSUXuAfw8G1iSm0B EFI94g/LAKqDvREpaRN1kdVQbyf9BqVS5kPGaDIilykDf/ZZmGEcqs4uiNYMc921LbqS N66BWmKJn2u5wvc8nf0W6zJKlx4NRrJAY2hd7w5styAiuxH2cSJF7QqtCjuGijkXnIfQ HIZ/QtSjJFXwH/lQfWCj200broBcw+H0cic5wrXrT1QfCjsm3vzdqyJhteUSKZVEGbBT V3Kw== X-Forwarded-Encrypted: i=1; AL+hErHDyfN+eE9VeeYQcrPWOTFtAJLqtt4AQyhzRaIjoAhvUE7Rlw8XBfXHOPiBrGqICKSBGxOQFXOq2fSWEK91@lists.postgresql.org X-Gm-Message-State: APuU4Z8rYUXJiaXi/eMV5wn8hia2MAGQwYlJgwnPn3oJ3N2j44O2n5GS qVv5yCpjUKA5bNak3ZGIDSSq5m+SeafGIxqIk10QKS2O8sOeiHlKlXsv X-Gm-Gg: AYBFou2SbYKL4pG1sej8ketb+Kve8+k6E1S3Uv5tKbixsJNulHce9nfmxORLINn5fG/ BN0B9oFR7qmF0QGbwTS0Eyg+yULhIceClXFlHybTnafeF+0S+arfe0Vxng0MqG4AWigKc8LOV+E o+uS7AwWWdHpT0utStNTvxviSjsydTM8rMfKNcYUH72/ZHOe6+4kj20stdQzqzE12F4DY4kZZjx c2BK4MYqYHGK0wDPQzgqSEadCqyma/cL0RExLzqqSpCMPnGHJW8vS7oxx3VJmXXNNgL5ASXaDeM MbpkNAj0RKdDCPjIr8F3bgyJs+GSBwwg4xUbw/o+w6ol8wv2d5SxELDW4Woen1wwYSWl/Aoa/6q EOqkjmNh2Dmr92nTq9wzHaRw7h0T3KxPDaEMbq06wBmSeWPGRrMAXjQu7Eh8SmxE7SAADgAML4N zUMRIVCc9wJdLAwE4A9IdIM4bOoUfJ1tVSKSuEa0PAMJpC2LEUy74hsObDXlb3WPvG+QCkkqOnS R65A/VRFtEJbASRR8oA5o2K5Dy+hGNXL1TB5VkUBiAqtpPaeouzwltMO8meK2xeuvrZBJmY/MUD 88xaxAF6Ix9b97UOc8mi0X8I10UgbAipREcw1hBfExAg7bnLw3Fo7fGx2U0zVYkBZc1TW9FgrQf swAxcksA7Xgmr04bR8JIA/H7dpCgCWqBBxHD65oV7s4kCJPG8v2ZQ8Jkg3kFA X-Received: by 2002:a05:6122:1b8d:b0:5ca:856d:cf80 with SMTP id 71dfb90a1353d-5ee34a7e643mr2646936e0c.11.1794692088248; Sat, 14 Nov 2026 13:34:48 -0800 (PST) Received: from NOTEBOOK-LAILA ([2804:14d:5c27:1387:a053:f15d:8c82:ed64]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5ee3df52b8esm2319978e0c.0.2026.11.14.13.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2026 13:34:47 -0800 (PST) From: Joao Rito To: Bertrand Drouvot Cc: shihao zhong , Nazir Bilal Yavuz , Melanie Plageman , Thomas Munro , pgsql-hackers@lists.postgresql.org Subject: Re: Fix ReadStream handling when heap rescan strategy changes Date: Sat, 14 Nov 2026 18:34:40 -0300 Message-ID: <20261114213440.96-1-joaovictor.rito@gmail.com> X-Mailer: git-send-email 2.53.0.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Bertrand, Thank you for the patch. I tested v1 (0001 and 0002) and it looks good to me. What I did: - Applied both patches to current master (165af118c5). They apply cleanly and build without warnings (--enable-cassert --enable-debug --enable-tap-tests). - make check passes (243 tests). The whole src/test/modules/test_misc suite passes with the patch (16 files, 169 tests), including the new t/016_heap_rescan_strategy.pl. - I also ran the new test against unpatched master. It fails there on "a rescanned sequential scan uses its newly selected bulk-read strategy" (got 0, expected > 0). So the test does catch the bug, which I think helps with the question of whether it is worth its setup cost. - I ran the query from the test by hand (shared_buffers = 1MB, max_parallel_workers_per_gather = 0) and looked at pg_stat_get_backend_io() for the bulkread context: - master: 0 reads, 0 hits in bulkread, with io_method = worker and io_method = sync. - patched: 468 reads, 104 hits in bulkread, with both io_method values. The query returns the same 11997 rows in both builds, and there were no assertion failures or errors in the server log. One small thing: the commit message of 0001 has an empty "Reviewed-by:" and "Discussion: https://postgr.es/m/" without the message-id. I guess you will fill those in later. I only tested the case where the rescan starts using a strategy. I did not exercise the other direction (the strategy is disabled on rescan, the extension case you described), and I did not test parallel, bitmap or TID range scans, io_uring, the back branches, or a meson build. Thanks again, Joao Rito