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 1v0h4A-00H57z-Ub for pgsql-performance@arkaria.postgresql.org; Mon, 22 Sep 2025 13:58:54 +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 1v0h3B-000lDf-LM for pgsql-performance@arkaria.postgresql.org; Mon, 22 Sep 2025 13:57:53 +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 1v0h3B-000lDW-B6 for pgsql-performance@lists.postgresql.org; Mon, 22 Sep 2025 13:57:53 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v0h37-002Cbz-1H for pgsql-performance@lists.postgresql.org; Mon, 22 Sep 2025 13:57:53 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3ee1381b835so2918558f8f.1 for ; Mon, 22 Sep 2025 06:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758549465; x=1759154265; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YVGnoTK41I+9dUqyqJoAxlSIi27C6GTsnxM5klmo63E=; b=GM4A2xjOuXXMmnDXgNuxlhO15GgZ3JGuOalXdJOM12JoPw5EJlqE1qWARVSoXZzOQ/ HMDiO1DoCVM1odxIqa1oVfylA+LbOqItRYmhwfR58lTM3MsuiNBUymQk/oGNRa5ebxnN r0ReLfFa6sMP0UXYFW5Z+1Yfd9Y59gogyYqp0Z2xx755WFG7mP6JQZo+sfBzvJDtMLE/ PTTxTg1akns64JWO+sdIcfY98JC5o2X0sEeELQrz7KFbJEf+3l96tA+3u3rSojZw/Cx+ bkXndIy0/+wnDw91abdknpUA8N6CydDUhWhsWTwiO0J6ygxFuyq4oYE3QvaDQEIO+NxA xaTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758549465; x=1759154265; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YVGnoTK41I+9dUqyqJoAxlSIi27C6GTsnxM5klmo63E=; b=IIEtjg5udtaY2HD1p9ll+GK8G2P1VKnUqj0r4HWBKnc7UmMIpxQhR+4IapGdEVk3cJ FeNTs8BqcVUdqWBsYgF7Tc+pw61KZ8QO2gexXBrr8oy+kK69EReiz/lyJccn+Uskx/si YAtZw/6ALZpOL9XTFkk/dFQGelorKWfeIuXeLLTwucwO4hlN96ktUPPL9Wf6Goova/Xk 5zUURI7cgDjixf4hlq/BqAdKfwdq+4KlAIfdruyHxWvBEApVwTTyxE5CHcLgIjFypz1p pNb86byAlT8j3aV7YA9w3LglggjTNFfLljxrVV5DCyj8ZayrexiioCkaEHmLwTnr8lZi ev6g== X-Gm-Message-State: AOJu0Yx+MwqoVOF4z+Qj5WRMfDGRUfHN3UBrvNNqwC3dZBuJ8tFuALLc AoSO8rOcmZVmi5Tt5zXTpYSYYRDvXvb7XruqtgPeuTAGD8G3Fey2/3TO X-Gm-Gg: ASbGncul/WG8igk9cLaJ8+uVdFRMmX0BjfKtOknr1AkqW0/mZC5GL2RFB496BjHgR12 EY+VE0h3zIuXVBOoqHGlrzYgHkGxXL5SyPKeJiLjPgTOh6mpEYUx4ys78FFd0wcjt1YpsC6cNAS tH3BhU/rWVR6is5pY/Zvqt/wVDzKpl7mZ9Vq+eNZPKLbVYG7NTRzo2gRv11oZ9H1nicFSKEIt7F VLXuOneb002yw7t2c06sAQ+qFErJcrSwMr1e+9ItLok+pMUQaOTWIrqulkzIGz2wQbIsqyJxVhb EReo9POax0saJKyKXtXH4aGH7SzyixitKdqEXWHsu+nlNHBcR9Wjv5grnWr7bLyAiowf7YtOre7 kt2PcBtVa4U6Iv4kt3PuV12LWYKEbLWwmy2cOrS6NVqfn X-Google-Smtp-Source: AGHT+IFjw1Z8lKtn0WPEoo60v4gUHE2ri4TcjFib/JjQLr8hwkxnKCRMRvAXn5haXeVkW6fddtzgXQ== X-Received: by 2002:a05:6000:2910:b0:3ec:4fe:860 with SMTP id ffacd0b85a97d-3ee85b4a18dmr11347180f8f.46.1758549464970; Mon, 22 Sep 2025 06:57:44 -0700 (PDT) Received: from [192.168.15.124] ([80.251.191.198]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3ee0fbffaeasm20021080f8f.62.2025.09.22.06.57.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Sep 2025 06:57:44 -0700 (PDT) Message-ID: Date: Mon, 22 Sep 2025 15:57:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Indexes on expressions with multiple columns and operators To: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= , Tom Lane Cc: "pgsql-performance@lists.postgresql.org" , Jehan-Guillaume de Rorthais , Christophe Courtois , Laurenz Albe References: <1507576.1758120083@sss.pgh.pa.us> <62133334-b844-4d0b-b248-1a8446757e5f@dalibo.com> <1916727.1758209549@sss.pgh.pa.us> <1972974.1758213639@sss.pgh.pa.us> <76fbd9ef-1fbb-49f0-bc8b-844462b18d1d@dalibo.com> <2432873.1758387110@sss.pgh.pa.us> <6ad08c0c-2c03-4b30-b5a7-dc486aa29c52@dalibo.com> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: <6ad08c0c-2c03-4b30-b5a7-dc486aa29c52@dalibo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 22/9/2025 15:37, Frédéric Yhuel wrote: > I wonder if this is an argument in favour of decoupling the sample size > and the precision of the statistics. Here, we basically want the sample > size to be as big as the table in order to include the few (NULL, > WARNING) values. I also have seen how repeating ANALYZE on the same database drastically changes query plans ;(. It seems to me that with massive samples, many of the ANALYZE algorithms should be rewritten. In principle, statistical hooks exist. So, it is possible to invent an independent table analyser which will scan the whole table to get precise statistics. -- regards, Andrei Lepikhov