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 1tJVv1-003VoT-C4 for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Dec 2024 10:50:43 +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 1tJVuw-00BiQd-E9 for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Dec 2024 10:50:39 +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 1tJVuv-00BiQT-CQ for pgsql-hackers@lists.postgresql.org; Fri, 06 Dec 2024 10:50:39 +0000 Received: from m16.mail.163.com ([220.197.31.5]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tJVup-001LNE-Pf for pgsql-hackers@postgresql.org; Fri, 06 Dec 2024 10:50:36 +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=LkAucvPYCFi2sKvqgJFXVGaLrGkRWqUk5piwyyPd+/8=; b=nX3t94iX8iCTMfwXWdf1QVL0kBpx+z47dGKMeOFV0QE0pumqo5BRPBe50QnY61 kBC6SgsACEteABnFodpiAE8f0IAmrDrZONen/FC0om5Kac8aUsynNw9a3/WOXSDK 5ZljeBihqePmcsqiJ/X305idEUPAV9avTBMvcbTu7xk7Y= Received: from lovely-coding (unknown [101.227.46.166]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wD3f2Hx1lJnozr+Lg--.64817S3; Fri, 06 Dec 2024 18:50:26 +0800 (CST) From: Andy Fan To: Robert Haas Cc: Etsuro Fujita , Pg Hackers Subject: Re: postgres_fdw: Provide better emulation of READ COMMITTED behavior In-Reply-To: (Robert Haas's message of "Thu, 5 Dec 2024 12:37:02 -0500") References: Date: Fri, 06 Dec 2024 18:50:25 +0800 Message-ID: <875xnxqe4u.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID:_____wD3f2Hx1lJnozr+Lg--.64817S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruryrAw1DGF48Ary8Cr13CFg_yoWDtwc_GF WkAr4rK3yDGrnrtwnayrsakFnIqFW8ur18t393K3yrta4rAryUXFZ5Xwsagrn3tw1qg3y5 C3s3XrZ2v397ZjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_WEE7UUUUU== X-Originating-IP: [101.227.46.166] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBZxStU2dSwvCKogABsj List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > On Thu, Dec 5, 2024 at 4:41=E2=80=AFAM Etsuro Fujita wrote: >> Comments welcome! Maybe I am missing something, though. > > I have a hard time seeing how this would work if cursors are in use on > the main server. Say I do this: > > DECLARE foo CURSOR FOR SELECT * FROM ft1 UNION ALL SELECT * FROM ft2; > ...fetch some rows from cursor foo but few enough that we only scan ft1... > ...do something that causes a snapshot refresh like issue another query... > ...fetch more rows from cursor foo until we start scanning ft2... Apart from the above issue, what do you think about that we are using a 'SELECT pg_catalog.pg_refresh_snapshot()' to let the remote do the refresh_snapshot VS 'a new message type for this'? There are lots of things happen in the 'SELECT' way like 'a extra network communication', 'a complete parser-planner-executor workflow.' With a new message type for this, we can send the message character with the next query together. if so, can the two overheads removed?=20 --=20 Best Regards Andy Fan