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 1sxpPz-00Cgw9-UZ for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2024 15:13:04 +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 1sxpPy-00C9Z8-Lc for pgsql-general@arkaria.postgresql.org; Mon, 07 Oct 2024 15:13:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sxpPy-00C9Z0-AA for pgsql-general@lists.postgresql.org; Mon, 07 Oct 2024 15:13:02 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sxpPv-002yHp-Rn for pgsql-general@lists.postgresql.org; Mon, 07 Oct 2024 15:13:01 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2facf48166bso51819311fa.0 for ; Mon, 07 Oct 2024 08:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728313978; x=1728918778; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7PhkMwYwlOijDHKB/keFrIYRXE10SWgDiBEh945uHns=; b=Xb0kGy1aTeSTh9Ia4WY+Kt+wkathmPzD3T9fLkHPl2ALFBqPO6K3q5ipxwWJNFRDZd +p6mzynM90aaQW1mvoy+IqRdyMcsBE/tFca15X3qguzWTsbjfuIKlr2KMrXsFfqdAXoR DvsFd8YCGXrqhDUhTIoox7qFKVXyvl+Qt83/vG8MyNUwysieHQgcm2A4YvAgxXLvc3aY TSOdiHpqmvXSBvTCR+Atx5clDvIEjAqO+h1H+Qp7/YXyTtANw+UFQOumDeRKFXNUaeB5 sZHEAhWZ8lUSrnic9qdcRxR1KJMo+UlB1z8DswuSiyl8HaQMlu6WBQCvrLSkJfGh0UMv Bs7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728313978; x=1728918778; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7PhkMwYwlOijDHKB/keFrIYRXE10SWgDiBEh945uHns=; b=NH9caqk/ZV26zDAuTb/nEddNmScM8IYBhOKAwVN5iCTsKRdXLQrFPPA46RpjVynYa1 jNTgrGPBjyc+mhP7FG4RlAzE8BkIU3u1n4h8RZ0ecc+/KGVBgONOxxVF12fS0RfZTK6I C1FfOYXuNQQlFmSbTnbccQXp8qtB51nwTBdTRVYOdqmLtAgw70hmibjVLnpNlxWrQk1r 1cDnjVIgGJSLdrxX+lFnAZHR1i8LsVxUQevJW5db58Bk9qxOTnuddFBaWumw8psDLTkV 7CmDAQefhUR2Hmlkqfp3ijrMi7/XTo6yX59XHLi4c0tT189wAMm3j+A2A286iAQBG4Rf CWdA== X-Forwarded-Encrypted: i=1; AJvYcCXeDBS+u7gSDJPM1uEgr2kv98ywNWQFV5jazw6/LzaChomhCJgdlPHGanLPI0Ri3XHmCejSO1EyZ4rq5a5G@lists.postgresql.org X-Gm-Message-State: AOJu0YyTjbecUWsjGhCNitBBzo0ACshFis2k2w7hkV7KkXSNQLfEa7xL 6QQD2AKyfv93wMxNm6kVv4XBbReEjqw8Dzss+vFXwVevCaXcjFoimOjxWH6qDlsgPOCDaUnvCD+ jlQ0GSWQCpX2VqOjdXDJo7wl4mVXWPg== X-Google-Smtp-Source: AGHT+IE1ZWXw+PN1Xxk7qmAlfHWvQ/8f+laCwg91NV68PADtYttT1vjrRM6qI/tOAFbh+TlMLk5l5Vt7/reHjcOILkc= X-Received: by 2002:a2e:d11:0:b0:2f3:f111:9bc4 with SMTP id 38308e7fff4ca-2faf3d79202mr49931431fa.43.1728313977755; Mon, 07 Oct 2024 08:12:57 -0700 (PDT) MIME-Version: 1.0 References: <28109.1727286817@sss.pgh.pa.us> <20240925215554.gfg24h5sp5aqesxv@hjp.at> <152525.1727302184@sss.pgh.pa.us> <20241005091424.34il2ss4noazgegx@hjp.at> <368259fb-fd2e-4a05-89e9-a733fae6d964@aklaver.com> <20241005203327.nb52nfuopdsjilvd@hjp.at> <1166698.1728162188@sss.pgh.pa.us> In-Reply-To: <1166698.1728162188@sss.pgh.pa.us> From: Greg Sabino Mullane Date: Mon, 7 Oct 2024 11:12:21 -0400 Message-ID: Subject: Re: Repeatable Read Isolation Level "transaction start time" To: Tom Lane Cc: "Peter J. Holzer" , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000b462680623e47499" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b462680623e47499 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Oct 5, 2024 at 5:03=E2=80=AFPM Tom Lane wrote: > As I mentioned upthread, we currently promise that xact_start matches the > query_start of the transaction's first statement. (I'm not sure > how well that's documented, but the code goes out of its way to make it > so, so somebody thought it was important.) > I'm not convinced this is terribly useful in practice, but it is good to know. I think if we wanted to do something here, it'd make more sense to keep > xact_start as it stands and introduce a new variable > snapshot_timestamp or something like that. I agree; I've been thinking about something like this, as it is too hard to try to shoehorn the information into the existing fields. Will throw this onto my "possible patch idea" pile. Then maybe we could have some guarantees about what you get when comparing > other sessions' > xact_start to your own snapshot_timestamp. But I'm not convinced we can > really guarantee anything without reading the snapshot_timestamp within t= he > snapshot-collecting critical section, and I'm not for that. > Fair enough, but even a not-guaranteed 100% accurate value might be better than the current situation, which is no (user) visibility at all about the (MVCC) visibility. Heck, even a boolean "snapshot acquired" would be an improvement (which becomes a subset of the info returned by a timestamp via null/notnull). Cheers, Greg --000000000000b462680623e47499 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Oct 5, 2024 at 5:03=E2=80=AFPM To= m Lane <tgl@sss.pgh.pa.us> w= rote:
As I mentioned upthread, we currently promise that xact_st= art matches the query_start of the transaction's first statement.=C2=A0= (I'm not sure
how well that's documented, but the code goes out of its way to make it= so, so somebody thought it was important.)

=
I'm not convinced this is terribly useful in practice, but it is g= ood to know.

I think if we wanted to do something here, it'd make more sense= to keep xact_start as it stands and introduce a new variable
snapshot_timestamp or something like that.

= I agree; I've been thinking about something like this, as it is too har= d to try to shoehorn the information into the existing fields. Will throw t= his onto my "possible patch idea" pile.

Then maybe we could have some = guarantees about what you get when comparing other sessions'
xact_start to your own snapshot_timestamp.=C2=A0 But I'm not convinced = we can really guarantee anything without reading the snapshot_timestamp wit= hin the snapshot-collecting critical section, and I'm not for that.
=

Fair enough, but even a not-guaranteed 100= % accurate value might be better than the current situation, which is no (u= ser) visibility at all about the (MVCC) visibility. Heck, even a boolean &q= uot;snapshot acquired" would be an improvement (which becomes a subset= of the info returned by a timestamp via null/notnull).

Cheers,
Greg


--000000000000b462680623e47499--