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 1tkYbi-004wdc-CY for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 01:10:34 +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 1tkYbg-002kcZ-UN for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 01:10:33 +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 1tkYbg-002kcR-KT for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 01:10:32 +0000 Received: from m16.mail.163.com ([117.135.210.3]) by magus.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1tkYbb-001fLp-0t for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 01:10:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=Ns0EStSoqhwRyOh4xifeVeLGW//3AmHQApWlEiV4PUk=; b=Q303GHtOERu8mikAxXMYVgg4ophIF7O+dHgtpYXrWoIWh1vK6cTm6okZM1CSKD xTVlWtoSfDvcbZiCbpBgBGFUtsn8flWSwQK6mugBgAMTjIBIcdFO9g8j/MibAp8H wHoqt+dhPqgAhQwNOyDUPmfs/5i0HCYn1yZ/IbpSQdz5g= Received: from lovely-coding (unknown []) by gzsmtp3 (Coremail) with SMTP id PigvCgDHHv59L7VnzQ8ZBQ--.6839S3; Wed, 19 Feb 2025 09:10:21 +0800 (CST) From: Andy Fan To: Tom Lane Cc: "pgsql-hackers@lists.postgresql.org" Subject: Re: Why does exec_simple_query requires 2 snapshots In-Reply-To: <1241667.1739893420@sss.pgh.pa.us> (Tom Lane's message of "Tue, 18 Feb 2025 10:43:40 -0500") References: <87o6yzbhip.fsf@163.com> <1241667.1739893420@sss.pgh.pa.us> Date: Wed, 19 Feb 2025 01:10:21 +0000 Message-ID: <87jz9mbuyq.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID:PigvCgDHHv59L7VnzQ8ZBQ--.6839S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruF1UWF13ZFyUAF1kGryDKFg_yoWxCFXEgr Z2kF93KanrGFyqqFW3AF13CF13JFW5CFn8JrZ0yr47Gw15Kw47u3ZYkFn5XF15Gr1UKrsx uw1DX3yUArZ5ZjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRCPfd5UUUUU== X-Originating-IP: [219.151.179.207] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/1tbioAj4U2e1IyTELQAAs- List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane writes: > Andy Fan writes: >> My question is why can't we share the same snapshot for the 2 cases? >> parser & planner requires Catalog Snapshot which should be the >> latest one, but in the above case, looks the executor can reuse it as >> well. Is there anything I missed? > > Many years ago, we committed a patch to do exactly that. We had > to back it out again because it broke too many real-world scenarios. > I'm too lazy to search the archives for you, but you might be able > to find the commit and revert by searching the git history. > > regards, tom lane Commit id is 532994299e2, thank you Tom! -- Best Regards Andy Fan