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 1tkfmf-005rEf-19 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 08:50:22 +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 1tkfmd-0065pT-9M for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Feb 2025 08:50:19 +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 1tkfmd-0065pJ-01 for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 08:50:19 +0000 Received: from m16.mail.163.com ([117.135.210.2]) by magus.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1tkfmW-001jK2-17 for pgsql-hackers@lists.postgresql.org; Wed, 19 Feb 2025 08:50:18 +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=MqPlCLBo0JVgvNW7HxEywowQFyWTUOK8F+QK+SHiJ7E=; b=LUpmILn47Ag9JD+lPk18iOW2Kc0+UNvoubQkdqxK0sPcg5bbImE4zAt/9EA5GG H6YvtV5uONv0k8GI9R2vSTHJ9KTGKIJ8KBqnNo26xCDuDbt3WPg9Ns/eIax8FQ0h cwlR+A7ClnhM64Zr9HqjqVsqm6zt+fu5XA9GN8lMgE8ns= Received: from lovely-coding (unknown []) by gzsmtp2 (Coremail) with SMTP id PSgvCgCH0fY9m7Vnc03uIA--.27741S3; Wed, 19 Feb 2025 16:50:05 +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: <1925004.1739932245@sss.pgh.pa.us> (Tom Lane's message of "Tue, 18 Feb 2025 21:30:45 -0500") References: <87o6yzbhip.fsf@163.com> <1241667.1739893420@sss.pgh.pa.us> <87jz9mbuyq.fsf@163.com> <1925004.1739932245@sss.pgh.pa.us> Date: Wed, 19 Feb 2025 08:50:05 +0000 Message-ID: <87frkab9oi.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID:PSgvCgCH0fY9m7Vnc03uIA--.27741S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrurWDuw17XrW7Kw4fAw43Wrg_yoWDXwc_WF ZFvF93K393XasrKrn3AF43uF45X3yUGF1kA395tr43ury2gF4fu3WkC3s5Ar47Ga4Yqr1D CwsrX3yUA393ZjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRtNVyJUUUUU== X-Originating-IP: [219.151.179.207] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBzwb4U2e1l51LRgAAs3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane writes: > Andy Fan writes: >> Tom Lane writes: >>> 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. > >> Commit id is 532994299e2, thank you Tom! > > links in commit messages till some years after that. Links in commit messages is a really great change. I have found more details at [1], the issue can be summaried as IIUC: The current strategy is below: t1: snapshot1 parser&planner t2: snapshot2 executor. which makes the committed tuple between (t1, t2] are visible to user, but if we share the same snapshot, the committed tuple would not be visible to user, Chaning it would be a behavior change. [1] https://www.postgresql.org/message-id/5075D8DF.6050500%40fuzzy.cz -- Best Regards Andy Fan