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 1tz5Xr-00ErHs-2w for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 03:10:39 +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 1tz5Xp-00GjnW-C2 for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 03:10:37 +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 1tz5Xp-00GjnN-1I for pgsql-general@lists.postgresql.org; Mon, 31 Mar 2025 03:10:37 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tz5Xm-0029Y6-1q for pgsql-general@postgresql.org; Mon, 31 Mar 2025 03:10:36 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-30bf7d0c15eso41910241fa.0 for ; Sun, 30 Mar 2025 20:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743390633; x=1743995433; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mwK5ZFbCUzo6qVDXHa2xiTYDTrItSckCqo8t9rQA6mE=; b=fiI8MHemR5sVL7LcsPeZimL617a+NrtUDOPD5kfyFunrApjauttL1szPYOdTKlSE3I H/3rBFS2CW+vzSDgliK9PcdFos8EhSqkpFE7VilbzKonihkfu6a0fu6CiGQKutCfaAIt Osx3WCgymJpsYvSd4LiFHwnZVic3ChGUoh0XmQYit+BFg1WrvDJrILYqTwIuJp4YXbYJ jd+QK+qB13xvKGkHdRQ2GiUn3qjef3caXs/CgMQ1p/g9gLhQKfc2csyzBNWaES8BrZ85 BxLtx9X1rD8BnV8zWLeu/ylrxBdMQ6uu92Zgvy5u1yCWfZD9hu3ufLbi0apKpACpUgpS ga5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743390633; x=1743995433; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mwK5ZFbCUzo6qVDXHa2xiTYDTrItSckCqo8t9rQA6mE=; b=Fz0mJ3PTGy5BgTZuF2eLtv5dhXTl7R/cUbBISYpxQ5t/3tTBR74RpOFbG54HMDB9QF XfWYU8fkma/GOUr7WdnErj5C/Y1hCZUSlKpL1KWWOnj9f7EFWYAx+REWVGeLHybzojFu o5bYvmKvtxhwlzUgzxRPUWclI3H70bKaDELE6lN+tOnyHbwq7z+lp3DPJ65Cq0CprAT0 5b/P8RqEIJsU/Ds5gaEmBkIQ7YRa6AVDqk4bpS5f42Dqwicc8TJWzik10yW9DPP5sFc7 5eJEMT3m84oFSuBBMqNOKQyeFJ6uqHUa9RFrn26+pmmODCCWQghJ6fPDjHctcmSlppPw I/zg== X-Forwarded-Encrypted: i=1; AJvYcCWo5H7AyCOpkq3QSkysRJ5F+sqrPB2yfe+PQSH+qXcPKZmBl9eERMaMMfYVBE2Glnd7wVOHPWcwWe+S9TYr@postgresql.org X-Gm-Message-State: AOJu0YzhX5boraw6Eal4KtfMVVuH6StoZxpl88VIHf5GQ73lDJUyzrzQ mcz7XsGzRm5RjkcnSnIF/UuDQVEGkuRZuxUlxA5kDGMoFwYNubHrXcdZB1fRFVO71KcL0AsFRGw 1NuN642t7AGZDDu0z/GrDoUOwHMs= X-Gm-Gg: ASbGncsYH/FXcQW6XNb1ScumXBaDFxJGx6ev1l70f4GgY5Q1fOFXCxygccYVDHfvwNd 9dsL/Y6j1C8ajApl6+0fR2VF6LyeTSunziPczPIqNfk2QtiGevOasfVv8AuNWVKiO/eE83h2aX9 fLEUzlhFhQBqxB5ZsxQ0oCTlzhBaugjktRNZZik9M9n4+OrWIvMDYtpfpYxLUD X-Google-Smtp-Source: AGHT+IFa/zHapRLZieEOvhHL83tR2GsCXiEFuS/TwZdRua8cLLmCZzjOOdt3VHSXIufoL2N/aHqk9LSsYBe1PCCxMWE= X-Received: by 2002:a2e:9fcb:0:b0:30b:9813:b010 with SMTP id 38308e7fff4ca-30de0349ecbmr23841831fa.31.1743390633143; Sun, 30 Mar 2025 20:10:33 -0700 (PDT) MIME-Version: 1.0 References: <01020195b987abd3-a008b77d-8c63-4931-80a4-be36a351c8b2-000000@eu-west-1.amazonses.com> <01020195dd9e8337-c912f36d-54ef-4d3c-a00d-5e697b308d33-000000@eu-west-1.amazonses.com> In-Reply-To: From: David Rowley Date: Mon, 31 Mar 2025 16:10:21 +1300 X-Gm-Features: AQ5f1JrEO5rbUgO6kz6i2U3jpR2F4V8rH-uvFqpq1HnPaHS1ZTrPERL8rQhJD4Y Message-ID: Subject: Re: Querying one partition in a function takes locks on all partitions To: Renan Alves Fonseca Cc: Evgeny Morozov , pgsql-general Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 29 Mar 2025 at 10:30, Renan Alves Fonseca wrote: > Currently, in the SQL function path the plan is always generic. The > planner ignores the function arguments. The plan_cache_mode setting > has no effect in this path. > > I agree that the docs should be more explicit about this. There is a > high penalty for using generic plans in complex functions. If you have any suggestions about where you think those should be added or wording for that, please feel free to suggest. For the part that's specific to partitioning, I've suggested some additional wording in the relevant spot in [1]. David [1] https://postgr.es/m/CAApHDvogvzANoTOCyXUWgEuPFx1nT6S63aAN0bDRSJ=TaGBWew@mail.gmail.com