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 1uEhCo-00Bdzs-6R for pgsql-performance@arkaria.postgresql.org; Tue, 13 May 2025 04:25:26 +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 1uEhCl-003Jj0-Gr for pgsql-performance@arkaria.postgresql.org; Tue, 13 May 2025 04:25:23 +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 1uEhCl-003Jir-6l for pgsql-performance@lists.postgresql.org; Tue, 13 May 2025 04:25:23 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uEhCi-001cJa-1u for pgsql-performance@lists.postgresql.org; Tue, 13 May 2025 04:25:22 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a1fb17bb8cso2991930f8f.0 for ; Mon, 12 May 2025 21:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747110319; x=1747715119; 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=4eEYNg+GKEHimTF+P0XMaLv1bsGX8ZamQg2w4CzDm1U=; b=ThYpLqSkAYYjhtSadvlrbgEuuVXDYIj3bCKnIGWOzucI0XeI2aR9Ieu9u8Q3gDvvFX DRVglbpDHeNqvHGFpxHw8DweKYoes+FmjHuO7P0/8aoSc6yET04gfynvgUECStNa0bjE w3a+lozURK+eSGiEp04e/kkZGNI1hI3I2u1p1H5lMUscq3LTnamBnJr7wPRVONCa/wEA HQm6MC260VYy7uen2GoAFJo1z6KPBhKlnYkqfc2Kd3zfmU++pPG511NWhOw28ivox6Z+ JCi3EdxVyrXvDsxNKHf1Z3XfAjHZ/j+PRciMMA8mTQwygBYzCytm8s9g1TtJCKje/4Er tHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747110319; x=1747715119; 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=4eEYNg+GKEHimTF+P0XMaLv1bsGX8ZamQg2w4CzDm1U=; b=L3espLlzRbYi0+Pol88I+QqvNJ4NVkxBqQSBwHIDVA7KwxtXOsUJGhYEQ7UzVLtfj+ GwKV8mnfnCGQk7PEpdZgqoP9qIORA1kA5BOMvRrGuAQn+gcG2PvrctazFOLCBbQwGTeL 1KrZB49n4+n71hAGLhiyhJJpS7qrumQkTqRsTndrku5T60I1ydAQvI0Ar8xrvCbLfyoz ZIoH7+xyQvkX8A3/TxjTOuBJKQtxd8cKOwtNC3dDDKyqFPlA2h5HSiReuna6JjzMsE/d ifSjHP1DXOGpwiuA+7xI5Y9nOG+vjx9hwRASsBOVPuI3f33esanW6u8H1yIgTSOmah8e 7I4A== X-Forwarded-Encrypted: i=1; AJvYcCUcCC/sn7T516kp//y9oMyE1aTVZKgaZ412x1prC+Trd0GzwB5tkhxhEx4iymCOnmqsKnNU5GBpCm9rKbFL4Luz6g==@lists.postgresql.org X-Gm-Message-State: AOJu0YzWlp5WHGVNShAQbXs2zUt3Dnhf2ykYQ+bFNy03doy+/P0l95jv iFN4Zhx3rUFYHUVKDH2GNH++Iks+zAQVymRIOsmOykC8aSbwt25A X-Gm-Gg: ASbGnctVAZHyTgoBoK9fz707yrlCkNEiJVsb0X7qRUW8Qlkpx4zc+weGAxFem8kdMez EU5RRz9ee5z4S523v4PMWjquULFtSJ9rCqd4uqY5iezUPEifB+sJUB9GgdO0Wep/RGHTz2AIsRb 5LAVC5c0I3ZN2HxTE+47nAkPYfLhDAFgRMIsq3Cx1aLCyNyUAK7uZ/g0Tl8bcP5xmt81AyBbtiN g12pORRo3A8iO/FA0grufoxRLbzWmF81BN0h2elR5MIHQozOQezucwzduFYf4ewLKJoSv6gcIyM R77iR1XQ9yu2NK3uIlq18yYiOB0ax0PwP4csLnKMl8sNOycAc+yLS8Adbl0iKFabjpbEyv0J2yY cfE4XogEQ0ZHzUb9QHKKI X-Google-Smtp-Source: AGHT+IEj0+jt9Qn13j9mI1Ag0dzKsRCc3HArUO5J1xKt3q0j+bLIwYyXEEQn0nJzDhFgOxoFWnj9tg== X-Received: by 2002:a05:6000:2207:b0:3a0:830a:3d63 with SMTP id ffacd0b85a97d-3a1f64277f3mr12558867f8f.9.1747110318725; Mon, 12 May 2025 21:25:18 -0700 (PDT) Received: from [192.168.0.89] (84.123.234.224.dyn.user.ono.com. [84.123.234.224]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f58ebe4fsm14905551f8f.39.2025.05.12.21.25.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 May 2025 21:25:18 -0700 (PDT) Message-ID: Date: Tue, 13 May 2025 06:25:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: inefficient/wrong plan cache mode selection for queries with partitioned tables (postgresql 17) To: Tom Lane , Maxim Boguk Cc: David Rowley , Pgsql Performance References: <38201.1747063982@sss.pgh.pa.us> <38869.1747073274@sss.pgh.pa.us> Content-Language: en-AU From: Andrei Lepikhov In-Reply-To: <38869.1747073274@sss.pgh.pa.us> 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 5/12/25 20:07, Tom Lane wrote: > Maxim Boguk writes: >> Reading the code - probably the lowest hanging fruit is to make >> 'The current multiplier of 1000 * cpu_operator_cost' configurable in the >> future versions. > > I'm wondering whether we should try to make the planner not expend > the effort in the first place, but leave partition pruning to the > executor, at least in cases where it can determine that that will be > possible. Significant planning time is a sorting out lots of scan paths, applying partition statistics etc. planner-stage partitioning reduces these efforts drastically. -- regards, Andrei Lepikhov