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 1vyR8G-0006zr-2P for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2026 09:06:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vyR8F-004EH5-04 for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2026 09:06:03 +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.96) (envelope-from ) id 1vyR8E-004EGr-2K for pgsql-performance@lists.postgresql.org; Fri, 06 Mar 2026 09:06:03 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vyR8D-00000000kRW-0bUn for pgsql-performance@lists.postgresql.org; Fri, 06 Mar 2026 09:06:02 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5a12c19affeso2061022e87.1 for ; Fri, 06 Mar 2026 01:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772787960; x=1773392760; 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=OuPTg1BKABJZgfAwiBKprKYuDpvF6z7e7O5QlGraLAQ=; b=CjMOPY/e+/4ms8tHf1Dcx6yWeXwgYtrmAiDeeM+icZRaeBGgS3dCZjgGKTn9uez2y/ HOdq5dLgW51WnjtdMKUQVJexn6K511l+3kn6UeH/1tXyOhXbGrawboPuEjGNzRWRePfp AasZc/2tVbVzLTiv6CJqTnUhZSfT7xDAqSZiUtOO6fmmf7QlgR6IKuioJ2DPm/M5xVwJ IzMDGFfYbCkCCyY4diD5Bvbtxrv8lQ7pFQpGnG5lg1kmrmwbdPRtpMGgaCzKf44lqu3H deuiqbz0zy9t1+6+cocm0d/QnWOWUugmmoMCIq9Nenl7Ab8g2tZcAlqKe1WYgvIoN8zY EnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772787960; x=1773392760; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OuPTg1BKABJZgfAwiBKprKYuDpvF6z7e7O5QlGraLAQ=; b=B64D8XGplrB5yX1U1PiYcl8LsdQz1v15je/GIboRVnvf8MRqarsC+HhII1IzY+Jyi1 w7vx6mVSYt0FEUXa2IITX3HR7RxxTdOkfMj58bgxMZNby2xbCXDK4qKKDyDVxSMXJ1u5 etnu9iknDprLpx/ZsEMYA9NBhgUyaYlaLfO0u3glHo3MhDBTLznTEag2lCLCJbQsqRDj GKBJY5yx6rw+/RH8cehmfXSM4M1gTSea4yzN3FgzWJqdDByUzgAMiHNP/7h0l3TlfzHV 9PrIfZjN+ssMj97boO6i6aByZUmgVXOBIc8pfJ4ksXz5/aYAxZGuUFN3Z+Yd0ew0W/Bb 3Hsg== X-Gm-Message-State: AOJu0Yywx3n5o1v6hH8qd3AU5dCgpygI3BUW5Pc3+zE6gYCyoLR0U16D 5662n0UaEIzLvcppPy6qNJ+WIz+6QLDKlvOgclc0VmXZvzTM6vhDt/dq X-Gm-Gg: ATEYQzwIoHo6nWwTEIdsB8dfsUJ5mjAGCnZ3N8M+QafX4uMq1XeLv6mzZ0eJF8Hg9gt J5xuoIxrLkfuJ1d+zM92XEFPHuJoHCd+UnG5bKNQHhn9dHWRgYueQeXbnornk0cH6lAmzcjxAZx TJN5JrTy7H0nIU4QKEWhPxPfHQD1Agk/0JnVRt2pIjgNXjlRtglcCstRxYnUj8pBsW6msQplJMv PuERiJl6fztYm0fhTL1Mv/zmXkpieZoKB0W+1GiUEMbXwFBltpnMCrhZVKdLriz6PHtnQRAnaTi cFo4z3cVd9shzkBw0IkCL2q8HqXBzD/ZsL4xmzd+lJh2DFBnlzVomSSi4AUE4CVY4rG8ZQk4Ivl llhRgw1WCBQmtWWbx/EzWVB9t3OWWRBIZsF2uADjFNG6nnb0Sxisd5uXSobJXgheQ5mcHyI+jxL q668jHnMGnQRzQhvN7Kp0W6E3RWsSwSqdMFFYgetQl2BgpMLn2 X-Received: by 2002:a05:6512:3a83:b0:5a1:357d:8d5c with SMTP id 2adb3069b0e04-5a1357d8e6emr1890783e87.16.1772787959356; Fri, 06 Mar 2026 01:05:59 -0800 (PST) Received: from [192.168.15.122] ([80.251.191.198]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a13d08bf6dsm219979e87.76.2026.03.06.01.05.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2026 01:05:57 -0800 (PST) Message-ID: Date: Fri, 6 Mar 2026 10:05:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Planner join order regression from PG 15 to PG 16+: 70ms -> 1440ms (self-contained reproducer included) To: Mauro Gatti , Tom Lane Cc: pgsql-performance@lists.postgresql.org References: <12c0b535-42f5-47c5-a8e7-45b4209e8ac9@gmail.com> <14531.1772747078@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: 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 6/3/26 09:24, Mauro Gatti wrote: > In any case, I don’t think there are other workable solutions without > changing the code. The gist of the issue is hidden [anti]correlations between columns. I like the idea of grouping columns into a custom type when an object in the data model is defined by several properties. This approach could help reduce the number of clauses, hide correlations within an object, and enable the use of histogram statistics. I'm not sure if this idea is ready to use yet, or if Postgres has everything needed to make it work well - just note. -- regards, Andrei Lepikhov, pgEdge