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 1rfEJZ-00GJSg-VU for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Feb 2024 07:25:18 +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 1rfEJX-008XAD-1k for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Feb 2024 07:25:15 +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 1rfEJW-008X9z-Jz for pgsql-hackers@lists.postgresql.org; Wed, 28 Feb 2024 07:25:15 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfEJS-001gtJ-Ma for pgsql-hackers@lists.postgresql.org; Wed, 28 Feb 2024 07:25:14 +0000 Received: from [172.30.0.166] (unknown [172.30.0.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id EA58CE2112C; Wed, 28 Feb 2024 10:25:07 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1709105109; bh=MTJ9Y9fZtX0ZryO3YFrs2bXeLekY6HiwtXqoFB/txuQ=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=zhV6xN78utt9Q0+iENycfW03gXrnLssPlK7YT+/VLB5Vfpe9fuaft7O5rCovFIYFl lyfTZn81GQ2DvdUMyA6jYls9o3owCIvH4x/X3Ho/AamO3CQJhx6wrpKZRdgg83WFR4 DZggxyV1gwjuklo6yBZmtxwRfyS6KaVAgX85VcQXNASI2izWSzF6MD21PT7Nwaohrr paVZQZogydgqIvCGnrQgCTzw1BiIHBgg4/fn6jxzHdWqEfCrk3IKzENfV2EzTGWnps z089FkGhpkdlA6TK66irdHCpOG2k5na+kw28zwR51/QSILlcXqZRQZ8vwayu4uS3SB X5Efi9UqmWbhw== Message-ID: Date: Wed, 28 Feb 2024 14:25:04 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: "type with xxxx does not exist" when doing ExecMemoize() Content-Language: en-US To: Tender Wang Cc: Richard Guo , PostgreSQL Hackers , David Rowley References: <7a6a807c-193f-4333-937b-8211b1330579@postgrespro.ru> From: Andrei Lepikhov Organization: Postgres Professional 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 28/2/2024 13:53, Tender Wang wrote: > The attached patch is a new version based on v3(not including Andrei's > the test case). There is no need to call datumCopy when > isnull is true. > > I have not added a new runtime memoryContext so far. Continue to use > mstate->tableContext, I'm not sure the memory used of probeslot will > affect mstate->mem_limit. > Maybe adding a new memoryContext is better. I think I should spend a > little time to learn nodeMemoize.c more deeply. I am curious about your reasons to stay with tableContext. In terms of memory allocation, Richard's approach looks better. Also, You don't need to initialize tts_values[i] at all if tts_isnull[i] set to true. -- regards, Andrei Lepikhov Postgres Professional