Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxx5u-0003Nn-I7 for pgsql-hackers@arkaria.postgresql.org; Sat, 13 May 2023 21:48:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxx5s-0005oo-2Y for pgsql-hackers@arkaria.postgresql.org; Sat, 13 May 2023 21:48:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pxx5r-0005oe-Op for pgsql-hackers@lists.postgresql.org; Sat, 13 May 2023 21:47:59 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pxx5k-002VUt-Ul for pgsql-hackers@lists.postgresql.org; Sat, 13 May 2023 21:47:58 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-50bd37ca954so100125536a12.0 for ; Sat, 13 May 2023 14:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1684014472; x=1686606472; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uBkSyfRMJjZxR6O2S0JS9ZRxOo75NjKNAOaT7jBNYSk=; b=mqw61RGFoGrKLqRpnKPKbB9X5dZGjHN3sTMByMobdB8QjJzG9SZvknsT4KZjj6mMdW Kkl6BvYdABNx25zTTws6meWDn0pjRMc5TWnmBOvK/E3B7/NW6SuJRbNXBYqD6sjaUEWJ qGFKR36RUItMX++bUnc9hh7Ep0tDmiA3Oc88NVCgYTDo+Cgqqq7VrD6prf84e/U1gJBC XN8cgvsEDcDkUVB3KXMPzBIaUdp4D13+gJA5Jm6rUKy/SoPiJDrkDjZQeCG40tYs1AQj zwd0T8FkmqnDMWGrALe2Q6rRtT1UQayhmIjx8FRL69bk4FLbZgedD2WVEQBGjVXjV6Gy 7Gpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684014472; x=1686606472; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uBkSyfRMJjZxR6O2S0JS9ZRxOo75NjKNAOaT7jBNYSk=; b=PI3ss0aQx28GPDttl1yF61WsJ+iMGeR7HP/vSyISme9scze65GcPY0VRncTNCwNs/i gPQAnbhn7lIqMY5Lj2lo4AHscc3LDOnV+VMQJFIY33Kic00v2WIkTyPBZ8t1DimBmdvd fXaMYUL3nBnHnUX11BMEJu42+3dhWYkMktaco69S27PLvRg/og/fbIyYBDejV8g3YZT4 zlXScNnYPYnGrfiubeEQLFuhdHXXcVQ8yzDv7ouJjIz2SMtLXGoQiByMN23eCPjjlHOl GpZ0jx68/Qjb2pWlN/GQMvSRQdRRbmWrgo7X0xq24uHbgKswA8GfB6KNtQl/NwWC/ORu YT5Q== X-Gm-Message-State: AC+VfDwvXySc8lgRa8hmJd+zSRkdzRJrH7aOaejkT9rlteS2f5c/YE9l dkSFM6VkTv/q7ef+xLDDjsachGwYATS2xXorO0jIlX/wIzDfp5KT+5KWnu2iTSbNq/Uoj8dT9ef DZu1z1xVNCQbly99stFnrCe9EBeF1MBcD1lSDB2D0mfdnX1u5FSkPESQD5gYBrhsVm6ojtCoebI 3Hh7vQ4D9kTLcCC5Ugk341ZwBHVkUpeTFh2w00/a6xIwlNAfdtFGlw X-Google-Smtp-Source: ACHHUZ7zCvdVIe+8eTh4lFSyz2CdIyUaKcgrnhDB/e6h7U2lmieGxMzJdS2cFidUbpbOxkir6AloxQ== X-Received: by 2002:a05:6402:3514:b0:50b:d86a:3f1c with SMTP id b20-20020a056402351400b0050bd86a3f1cmr24744945edd.18.1684014472015; Sat, 13 May 2023 14:47:52 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id t14-20020a170906268e00b0096aae0b36a1sm2518526ejc.33.2023.05.13.14.47.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 May 2023 14:47:51 -0700 (PDT) Message-ID: Date: Sat, 13 May 2023 23:47:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Memory leak from ExecutorState context? Content-Language: en-US To: Jehan-Guillaume de Rorthais , Melanie Plageman Cc: pgsql-hackers@lists.postgresql.org, Konstantin Knizhnik , Thomas Munro References: <455abe0e-91b2-f428-6f4c-b95c7c8dfb52@enterprisedb.com> <20230320151234.38b2235e@karst> <20230327231323.08277083@karst> <20230328151745.0f6061f8@karst> <20230331140611.3695d30d@karst> <20230408020119.32a0841b@karst> <20230504193006.1b5b9622@karst> <20230508155648.lzddwywo6emote2b@liskov> <20230510142419.6185a492@karst> From: Tomas Vondra In-Reply-To: <20230510142419.6185a492@karst> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Thanks for the patches. A couple mostly minor comments, to complement Melanie's review: 0001 I'm not really sure about calling this "hybrid hash-join". What does it even mean? The new comments simply describe the existing batching, and how we increment number of batches, etc. When someone says "hybrid" it usually means a combination of two very different approaches. Say, a join switching between NL and HJ would be hybrid. But this is not it. I'm not against describing the behavior, but the comment either needs to explain why it's hybrid or it should not be called that. 0002 I wouldn't call the new ExecHashJoinSaveTuple parameter spillcxt but just something generic (e.g. cxt). Yes, we're passing spillCxt, but from the function's POV it's just a pointer. I also wouldn't move the ExecHashJoinSaveTuple comment inside - it just needs to be reworded that we're expecting the context to be with the right lifespan. The function comment is the right place to document such expectations, people are less likely to read the function body. The modified comment in hashjoin.h has a some alignment issues. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company