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 1v1jRb-00C39b-Fp for pgsql-performance@arkaria.postgresql.org; Thu, 25 Sep 2025 10:43:23 +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 1v1jRa-001rfX-5h for pgsql-performance@arkaria.postgresql.org; Thu, 25 Sep 2025 10:43:22 +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 1v1jRZ-001rfP-Rg for pgsql-performance@lists.postgresql.org; Thu, 25 Sep 2025 10:43:21 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v1jRX-002LjS-2B for pgsql-performance@lists.postgresql.org; Thu, 25 Sep 2025 10:43:20 +0000 Received: from [192.168.1.11] (5-49-10-71.hfc.dyn.abo.bbox.fr [5.49.10.71]) by mail.dalibo.com (Postfix) with ESMTPSA id B618227EF7; Thu, 25 Sep 2025 12:43:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1758796998; bh=Ugng6Gzs8SALM9+Z3rtA9Xz7tL70CsIhwsDIcU7ksfY=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=S7t784iRGr3v2Shh/02bxhxUEumETGvSXWkd2tT/8SMBNvmfe88XfGt2gd8P6wCYE 5nHmY80CiJYHzM0/14hbAE5gpBG5Pw83fEEk3gxZdJPbESUe2/e6GxkF3T6cjinBez FQQxUOTm2HrSY6nTD6cvG7zRBRXmkJmJnGCwj8fI= Message-ID: <9dd373f9-eb61-4ddc-aa06-99e4ff13a19d@dalibo.com> Date: Thu, 25 Sep 2025 12:43:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= Subject: Re: Indexes on expressions with multiple columns and operators To: Andrei Lepikhov , 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> <493a013c-63d1-467a-b9ec-352f77baf37a@dalibo.com> <9756a3e9-5dea-4506-a077-72a4d9c302df@gmail.com> 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: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/23/25 15:31, Fr=C3=A9d=C3=A9ric Yhuel wrote: > To get back to the topic of partitioned statistics, do you know if SQL=20 > Server is smart enough to handle this case [1] that we discussed last=20 > year? (with filtered statistics) >=20 > [1] https://www.postgresql.org/message-id/flat/b860c71a-7cab-4d88-=20 > ad87-8c1f2eea9ae8%40dalibo.com >=20 Sorry, it doesn't make any sense. First of all, it's not possible to do something like this with SQL Sever: CREATE STATISTICS OrdersStats ON orders (id, product_id) WHERE product_id IN (SELECT id FROM products WHERE name =3D 'babar'); this is because you need to use simple scalar expressions in the filter=20 clause. An even if it were possible... it would be completely useless in this=20 case. Sorry for the noise.