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 1vGHJb-00BUjp-UF for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Nov 2025 13:43:15 +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 1vGHJa-00E2Gg-GD for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Nov 2025 13:43:13 +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 1vGHJa-00E2GX-7l for pgsql-bugs@lists.postgresql.org; Tue, 04 Nov 2025 13:43:13 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vGHJU-005wHD-0G for pgsql-bugs@lists.postgresql.org; Tue, 04 Nov 2025 13:43:12 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-47112edf9f7so44952135e9.0 for ; Tue, 04 Nov 2025 05:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762263786; x=1762868586; 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=3z3OhXTVSzJJyYobSZDJVxgEAxJ11bIJz30BnE8smFE=; b=iImOiGCXIWLfl8inuFfiTpZVK8p68WW7AjFTWuYNIwCCRg3kgbyoUZP2zC3iglKUY9 vlMlfWqDNMghlC7lS3BxohNJ3tpIvml5rRq03xbMelnigm+os4mbUWw/zazcPNll5DM6 xBZOPDRfr55bF1XZUV2dhhM4nUW/BqRzzGK/RJ6n2rBEjnLLxc2RBY/7dAqjw8UHakDI JPpKifJ97Ruh0Yyf5xQG8rPCBO5eL/ydio6/ETIXbmI7rIHGn1C5fw7BZgCAjG66OX6A JEy9/WEjxdb+gFiNVFKE3rXNbQ1AaBr1PY/zhFRC6VxONQEXPyRyQPoIbuKGu65yrAOr x+mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762263786; x=1762868586; 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=3z3OhXTVSzJJyYobSZDJVxgEAxJ11bIJz30BnE8smFE=; b=q7fY8K40I/K1/dHtULdWKuLhMzlcLpmDndCXEkPqH4CoGlzW4dc851SJ2ZgNgu9cIA /GIJC86L+WiNWPeQE1y6k1kQsQx7pGIVCm2nyq30Tf1hlXOyb8gmcTYw2zPEeUIcOAWT WKEzr508Osg9Oqol0fAKqn0Lvy98bALcB6cEMxxd5R2ift/RYh7wlsMSgLjZtzjS6KfC FaGnjdOBZuT7BU/SSpBiAI4RzY7TOYy5NmNQcrTynlojhOkn/S6oAPjyZZARPE0ZqPWK Ln+SL3VzyMzKu66SCIVLdhcCjk47rEB+xxoF/USdqHvK6phXT4POi1xD/rQb/DS7PLEe xPkA== X-Gm-Message-State: AOJu0YzKDs56uU5KtFK016UIF2spQ12nx62fDVjrOjmYtAzRApWoC+xA khUwa7mUPrKi2VMhHbBA7rX2JJLnjgSudCy14+bVuzWHveSGpdN+9pPR X-Gm-Gg: ASbGncuo6crlQTlbenMUKm5j1XqBzfQ1UjlslDN7kPqpnarLFJEPmCSHCUaa9ZKTAjM 49i/DJBjtKPdiMwLjaICmozPY4wqgovi6nKPnl8oEzJyXTLxwWA4wQT1ONkp4ZQ1oiMC4dD2q/o 2mEm7U/f2AX9jVKIn4Aj6VoFRbwdUiUaEFlddxkGHa026Rl6GbpqhqqWTn3UGlGDnmoCSaKYDE1 bfNvvrB5NENJY4R46T5TYRNkwc9dCAdCRSffdeiLV4FuHSXrcuYTU9Bm/7SqxN3Yii8P8KzH0n2 VxFH8dyqrxOUb/eANWZarajkwyVlHl2rCccXmOQokWgYx3kSQ6bpmt2uFyqlffwIf84dyty1UAV AdmqH5gyRipTLWBkhtz9W8Elv0dwDeBJTu28PU4fLrHripcysJZ6pnrU3CbPr+LlTLJSxcuhd/X cwHXgKW6ikBj0= X-Google-Smtp-Source: AGHT+IENwV0qeuz5G3KPU+xHZaXd+KGuErEd2bCwrO44MXfz4oSSde6BdXHD3YYvE6YtAjCNm/rdBA== X-Received: by 2002:a05:600c:64c6:b0:477:df7:b020 with SMTP id 5b1f17b1804b1-477308303acmr122099455e9.18.1762263786287; Tue, 04 Nov 2025 05:43:06 -0800 (PST) Received: from [192.168.15.209] ([80.251.191.198]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47751794620sm87883005e9.6.2025.11.04.05.43.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Nov 2025 05:43:05 -0800 (PST) Message-ID: Date: Tue, 4 Nov 2025 14:43:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19102: Assertion failure in generate_orderedappend_paths with aggregate pushdown To: Richard Guo Cc: pgsql-bugs@lists.postgresql.org, akorotkov@postgresql.org, Kuntal Ghosh References: <19102-93480667e1200169@postgresql.org> Content-Language: en-US From: Andrei Lepikhov 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 4/11/2025 08:44, Richard Guo wrote: > Any thoughts?The first patch looks good, but I still have a couple of questions. 1. We don't use parameterised paths in MergeAppend yet. I wonder if it could be nudged by spreading the use of partitioned tables with foreign partitions. Do you think, in such a case, the usage of cheapest_total->rows will stay correct? It seems that the parameterised path has much less estimation than the RelOptInfo... 2. I understand why the upper relation has unset nrows. However, it may be more accurate to set row estimation for a pushing-down upper RelOptInfo. Or, at least, describe in comments why this is desirable behaviour. It would be profitable, at least, for extension developers. I also support the second patch. With many partitions, it allows us to save a significant amount of CPU cycles. -- regards, Andrei Lepikhov, pgEdge