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 1tzIcK-000Tol-Bp for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 17:08:08 +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 1tzIcJ-008w9Q-0b for pgsql-general@arkaria.postgresql.org; Mon, 31 Mar 2025 17:08:07 +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 1tzIcI-008w9I-KN for pgsql-general@lists.postgresql.org; Mon, 31 Mar 2025 17:08:06 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzIcG-002B34-2z for pgsql-general@postgresql.org; Mon, 31 Mar 2025 17:08:05 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5ec9d24acfbso10835247a12.0 for ; Mon, 31 Mar 2025 10:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1743440883; x=1744045683; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=ey2el/NQFCgqN/kgPwDWZUj9fyx7R79nntXFlILCKEc=; b=NPlJkmSr3+qsoHN9gIDhExIBzz5GA6M8kswajf2XiWdRtvNVjzFPHvAh92z77BfKKo wB5vBknwquCNB9aBMOWCwmku3FncGIGgjstzbl0vTtBs+nO88oPs2UeN1KD7ph/PVfNM CzuCiclm7veIEo9ps/QQ/F+AJwcId0U+JtDUdDLFn2DWirWAJS9zA5IGhfjU9EQ7VsUT COOTKJ+PDB5eiK59u7Gcvy2RPtHflGUlIUBaA3b2jVIy7wvz1VxV/J+r6+tPUfW0AoW5 er5Qt9PiDW3+i9HDvRGgy4uAwAdpmcG/7I7aHXrmmhzDxz84TgUjCyghWy32dLLbc6bm mBjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743440883; x=1744045683; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ey2el/NQFCgqN/kgPwDWZUj9fyx7R79nntXFlILCKEc=; b=ku1S6ppP28WVimHWrW1ZvB6VluHvscaw4nyHEeSH7aVMoQXeBm0fhuE5d8F0tce8Li X3BhNLTzXNGTiOXi2Ucy+m4tSg1SjyDhIhYDt0FmnuZIs/8LW3k/Nv9NCJK3gx2Zz8mk oSYvcI6PSnZG/y0T0pDLIEHMLFKjLOMAGnq19zSlWgMmiNQpwDLZ5WpSXzr3jKGddfCt ft9qM/WPBCmkh8pdeqFmyXZjLkoG+CONXaVdJJgi3xcQgJ9WgcT+05WLCs06eO4wRTeX sgNc/e+lbZfNRgotGHpt20b31YyHco7p1J0oV6NZMj5ReSXqW5F/WcJgiD/r1O0IjJMn sHDQ== X-Forwarded-Encrypted: i=1; AJvYcCWVXctDOy1bvf3GqrA3j1NNXFZKoFGkLZ48K7AvFAtZTKajgl6KUNbrdbG/46Kn9fkCrKnssjd59Uaoos9C@postgresql.org X-Gm-Message-State: AOJu0YxmlSWmBgfJHUPlSNrl7Z9QJ2D3rn2iyXWDesw0aQZyrw9wC1sX epP8l0IJxh74iFA7Efu3M0+P9UAfhuerzxdODYy2EZnchySnk1I8VHmAIHr87Hw= X-Gm-Gg: ASbGncvdS/aUzbFBODpXjDstu4UeFIr7Gwgz2GH/rsDevaU0U0h5vzTy7FEFrDk/wLV MsK2+9/K4wmoaQ7a/h3aJw8nLzI56OdRO7929qTFrwZTaDQ549VVgKMDjlxDQlgOPlMOLR3y55G wIeHwgtN/2cIslph3XgiPiGC6+O+tJapyqQbFSOGobub2xkIN6gu30kiB9iAff2/v5uE9Ykn6wu OYm8yxyFeJT3jiKFnDe2JKDDUuaHD8ssM25hpFAE4qiw6Qi1MN5dG1PchUj5CyHVBCxyFrMDOpx mt0ZBfGsOwMgLcYeOvWRTzXD1eODQAopACm+cgNm0tLbnRmYbHmz/CNCBLHk8do= X-Google-Smtp-Source: AGHT+IE0SxllXSp5SdMPB2WgsBGvpuK28PC8cT/sK9YXYERHsHdYWBVilqDgD7uLYpXDo/NBzpGJPQ== X-Received: by 2002:a17:907:9708:b0:ac3:ed4d:c9a1 with SMTP id a640c23a62f3a-ac73683ab37mr948329466b.17.1743440883205; Mon, 31 Mar 2025 10:08:03 -0700 (PDT) Received: from localhost.localdomain ([2001:871:260:1ec1:a6fd:9723:610:9f1]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac71927b0d9sm642679066b.42.2025.03.31.10.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 10:08:02 -0700 (PDT) Message-ID: Subject: Re: Querying one partition in a function takes locks on all partitions From: Laurenz Albe To: Renan Alves Fonseca , David Rowley Cc: Evgeny Morozov , pgsql-general Date: Mon, 31 Mar 2025 19:08:02 +0200 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-03-31 at 18:41 +0200, Renan Alves Fonseca wrote: > I would add another Note below like: > "Except when inlined, an SQL function is always executed with a > generic plan. This behavior may not be desired in some situations, and > it will be fixed in future versions." But that is not true, as far as I can tell: just like any other prepared statement, it may keep using custom plans. Yours, Laurenz Albe