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 1tOYBr-0076mc-1D for pgsql-performance@arkaria.postgresql.org; Fri, 20 Dec 2024 08:16:55 +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 1tOYBq-0077nz-9f for pgsql-performance@arkaria.postgresql.org; Fri, 20 Dec 2024 08:16:54 +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.94.2) (envelope-from ) id 1tOYBp-0077k8-T1 for pgsql-performance@lists.postgresql.org; Fri, 20 Dec 2024 08:16:53 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOYBn-000il2-FL for pgsql-performance@lists.postgresql.org; Fri, 20 Dec 2024 08:16:53 +0000 Received: from [192.168.0.7] (5-49-10-71.hfc.dyn.abo.bbox.fr [5.49.10.71]) by mail.dalibo.com (Postfix) with ESMTPSA id 4F4CB27C27; Fri, 20 Dec 2024 09:16:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1734682610; bh=80caF9lGOHW42fzOlpBO6wXLRasm8SC5gFjFAOkTDEI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=I/v6Q2GL7ewTRzsL0eRMg8640OioxLQp1c0waxCQXSg3618oqzu6xWPO38yS4Pz3B kZ/FO+4IfET5qJjPy1tUOXmFdXlxdMuMqSd7kJX8g+x6NCzZwQy04SF82d5eYhleaG nm7Y7ixQ5abcVbH1hotVWbDvzXOnU5ViSY988AHM= Message-ID: <43c7d623-1805-4db2-a8fc-9a99d3633320@dalibo.com> Date: Fri, 20 Dec 2024 09:16:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Why a bitmap scan in this case? To: Jon Zeppieri , Greg Sabino Mullane Cc: pgsql-performance@lists.postgresql.org References: From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= Content-Language: fr, en-US Autocrypt: addr=frederic.yhuel@dalibo.com; keydata= xjMEXn3bgxYJKwYBBAHaRw8BAQdA6tX5FT/n5ztMWIoBdl6k5avvu65fv6ryfVzIx/aH3V3N JEYuIFlodWVsIDxmcmVkZXJpYy55aHVlbEBkYWxpYm8uY29tPsKWBBMWCAA+FiEEi7OTyf6H ePS+C6n11XGWhN8zGNUFAmZDVJ8CGwMFCQtfi90FCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA CgkQ1XGWhN8zGNV65gEA6o+UrebFjn2CIAOYwP3CiiJugiM5TMH9yJyehQua5ZoA/2ChxiVn 8OUaAw/ErxJmQi1mSN0tNZBL/KhkUPBDUDQNzjgEXn3bgxIKKwYBBAGXVQEFAQEHQCuh5cLQ AtEBXHa2Fmtp0kduBu7msM7qO/gaEcdjFUdiAwEIB8J+BBgWCAAmAhsMFiEEi7OTyf6HePS+ C6n11XGWhN8zGNUFAmZDVJ8FCQtfi90ACgkQ1XGWhN8zGNWOOAEArSqePBqfd4Kx4ulACaWO 6fM+XSDfUlBAQXx9rU6DR4MBALwozl9g91tRysim6lKxggvBfp/PvbpTZNrxYLWB2fYP In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/19/24 20:09, Jon Zeppieri wrote: > The table is freshly vacuumed. If I disable bitmap scans, it will do > an index only scan, which performs better. For the bitmap heap scan, > it says "Heap Blocks: exact=27393," whereas for the index only scan, > it's "Heap Fetches: 27701." So you have 100% heap fetches. Are you sure that your table is freshly vacuumed? Please note that VACUUM FULL doesn't create the visibility map, so you still have to run a plain VACUUM for this.