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.96) (envelope-from ) id 1w9TL7-001SjH-0j for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 19:40:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9TL5-004jYM-2B for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Apr 2026 19:40:56 +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.96) (envelope-from ) id 1w9TL5-004jYE-0u for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 19:40:55 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9TL3-00000000mFF-05VY for pgsql-hackers@lists.postgresql.org; Sun, 05 Apr 2026 19:40:55 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id E4E963EC69; Sun, 5 Apr 2026 19:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1775418051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sH7qiqkMardlnuwybEwLHjDwQ0Z8nnIjihHpf+H8ZQY=; b=oYD7UURgFo4sVoKTskZ+VjgkUr/nxtnCoNDEd6QLvxITdCS3tcpLoBOCQVhnh7W2W8R2ru EW+9l/UIfMZUE1h14H6YHDTfccb/HFltcsIPDhlZpNOA+ElGcCqluURdKLeAxLCE1eO24z j6fXLmnEJoiyy+w8wSOhvigX+1NQrjQkhpOIROef/TqB9LVMPJrB0gP3wqhcEVNLMAifMo 3oSzbQupEgDWHJuC+qxMLJt9DEXodrBuL4oX3pyP4s66ELZhjuqW2S+QC4ol1h1XlBElOE 3F3QUNSi5/H6liA2gpy6m8wBN8L1/IFPsSOxRUAEVv6zAKcQqX9xwv7nzZkRjA== Message-ID: <7b8ba18a-548c-4a2f-962c-e50a3f902607@vondra.me> Date: Sun, 5 Apr 2026 21:40:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE To: Melanie Plageman Cc: David Rowley , Masahiro.Ikeda@nttdata.com, lena.ribackina@yandex.ru, donghanglin@gmail.com, geidav.pg@gmail.com, tomas.vondra@enterprisedb.com, dilipbalaut@gmail.com, pgsql-hackers@lists.postgresql.org, hlinnaka@iki.fi References: <13bd913f-94b6-43cf-b849-4d762e5297d8@yandex.ru> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: tomas@vondra.me X-GND-Cause: dmFkZTFVEZ2TecjpsbjeqOBNNi9p3BHraEofedRkmpWD1tOQiocm76Ue1r1EFAZkVpL3DtUWkH2rF7gnedToa7NIAPr1GNFTLltazswkbBF1ZNkq9rUUHqZ78GiteJhzTtNr4HUwrUeuMJlUGkjEYI6B4ZfhbVksmzAraaSK4s/ore8r9i5bq8VPtX03rTOdgKuvkPCTS4r0WIeQ4+vk3/yLEsalP7Ot00yJgkFDPIT3ZC706HUputB/cuT3zEYc9lLXp7MUNJZ11PB0+ms5dOhOVAZg0l77r9ebJ3uk36MG+aFElSJ/K7J8zW+XzBJ4fXv4T5HLs5BjkKS5X/adQsfXjQixEBwokjrwidJfuGVnQ1MPOGIYiooAn6skthBlvIQ6m02hGMKijmdowZ65/0su1xzTVwCeXlm0+Q6xwdWXlfyVnck9NCtAcPtQvwJeq4uLLpqGPqYU6xiORdCxwNxtYJV1YJ//MMxidwy9yV+2uG9cDSkpwqWDE72fN2zkss/MESd3AaUpqWYvNigY1Xcm8qAUbxg0jm88XlBkOxkd6+ruk577Ev1X8Nz5Gsoqsnsb8cmT84n/Zh5aUkSxUV1BU/AugVmB62JNn4Sm9oSHlmwVASiVIxZzPuK1j5sb9MXBV1HD2Gvs/JOQ0keqYv8xWsBhqbTcXcYfmJHfmLzE8fM4HA X-GND-State: clean X-GND-Score: -100 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/5/26 20:27, Melanie Plageman wrote: > On Fri, Apr 3, 2026 at 3:20 PM Tomas Vondra wrote: >> >> I'm working on adding information about prefetching for scans [1], which >> includes BitmapHeapScan. I realized the instrumentation added by this >> thread may not be quite right, resulting in missing instrumentation for >> non-parallel-aware scans in a parallel query. >> >> A better description / explanation of the issue is posted here [2]. I've >> posted a proposed fix in the following message [3], in a patch: >> >> v8-0002-Show-Bitmap-Heap-Scan-stats-for-non-parallel-awar.patch >> >> I wonder if someone from this thread could review my analysis, and >> confirm this is not intentional. I don't see it discussed in the thread, >> so I assume no one noticed this behavior. I'd also appreciate a review >> of the proposed fix, or suggestions for alternative fixes. > > I can't imagine this was intentional. > Indeed. > I reviewed your approach and suggest we aim for even lower impact by > always allocating the ParallelBitmapHeapState. That means the DSM > layout won't differ such that pcxt->toc has to point to the > instrumentation in the parallel-oblivious case and the pstate in the > parallel-aware case. Attached is a patch that does this. > I like this approach - it's much simpler / less invasive. It did not occur to me to use the parallel_aware in BitmapTableScanSetup. regards -- Tomas Vondra