pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
what's hsitoric MVCC Snapshot?
3+ messages / 2 participants
[nested] [flat]

* what's hsitoric MVCC Snapshot?
@ 2023-03-05 14:49 jacktby@gmail.com <jacktby@gmail.com>
  2023-03-05 15:58 ` Re: what's hsitoric MVCC Snapshot? Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 3+ messages in thread

From: jacktby@gmail.com @ 2023-03-05 14:49 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Here are the comments in src/include/utils/snapshot.h.
        /*
* For normal MVCC snapshot this contains the all xact IDs that are in
* progress, unless the snapshot was taken during recovery in which case
* it's empty. For historic MVCC snapshots, the meaning is inverted, i.e.
* it contains *committed* transactions between xmin and xmax.
*
* note: all ids in xip[] satisfy xmin <= xip[i] < xmax
*/
TransactionId *xip;
I can't understand the historic MVCC snapshots? can you give me a scenario
to describe this?


jacktby@gmail.com


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: what's hsitoric MVCC Snapshot?
  2023-03-05 14:49 what's hsitoric MVCC Snapshot? jacktby@gmail.com <jacktby@gmail.com>
@ 2023-03-05 15:58 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2023-03-05 16:00   ` Re: what's hsitoric MVCC Snapshot? Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Adrian Klaver @ 2023-03-05 15:58 UTC (permalink / raw)
  To: jacktby@gmail.com <jacktby@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

On 3/5/23 06:49, jacktby@gmail.com wrote:
> Here are the comments in src/include/utils/snapshot.h.
> /*
> * For normal MVCC snapshot this contains the all xact IDs that are in
> * progress, unless the snapshot was taken during recovery in which case
> * it's empty. For historic MVCC snapshots, the meaning is inverted, i.e.
> * it contains *committed* transactions between xmin and xmax.
> *
> * note: all ids in xip[] satisfy xmin <= xip[i] < xmax
> */
> TransactionId *xip;
> I can't understand the historic MVCC snapshots? can you give me a scenario
> to describe this?

 From the same file:


/*
  * A tuple is visible iff it follows the rules of SNAPSHOT_MVCC, but
  * supports being called in timetravel context (for decoding catalog
  * contents in the context of logical decoding).
          */
SNAPSHOT_HISTORIC_MVCC,

> ------------------------------------------------------------------------
> jacktby@gmail.com

-- 
Adrian Klaver
adrian.klaver@aklaver.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: what's hsitoric MVCC Snapshot?
  2023-03-05 14:49 what's hsitoric MVCC Snapshot? jacktby@gmail.com <jacktby@gmail.com>
  2023-03-05 15:58 ` Re: what's hsitoric MVCC Snapshot? Adrian Klaver <adrian.klaver@aklaver.com>
@ 2023-03-05 16:00   ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2023-03-05 16:00 UTC (permalink / raw)
  To: jacktby@gmail.com <jacktby@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

On 3/5/23 07:58, Adrian Klaver wrote:
> On 3/5/23 06:49, jacktby@gmail.com wrote:
>> Here are the comments in src/include/utils/snapshot.h.
>> /*
>> * For normal MVCC snapshot this contains the all xact IDs that are in
>> * progress, unless the snapshot was taken during recovery in which case
>> * it's empty. For historic MVCC snapshots, the meaning is inverted, i.e.
>> * it contains *committed* transactions between xmin and xmax.
>> *
>> * note: all ids in xip[] satisfy xmin <= xip[i] < xmax
>> */
>> TransactionId *xip;
>> I can't understand the historic MVCC snapshots? can you give me 
>> a scenario
>> to describe this?
> 
>  From the same file:
> 
> 
> /*
>   * A tuple is visible iff it follows the rules of SNAPSHOT_MVCC, but
>   * supports being called in timetravel context (for decoding catalog
>   * contents in the context of logical decoding).
>           */
> SNAPSHOT_HISTORIC_MVCC,

Also:

typedef struct SnapshotData *Snapshot;

#define InvalidSnapshot         ((Snapshot) NULL)

/*
  * Struct representing all kind of possible snapshots.
  *
  * There are several different kinds of snapshots:
  * * Normal MVCC snapshots
  * * MVCC snapshots taken during recovery (in Hot-Standby mode)
  * * Historic MVCC snapshots used during logical decoding
  * * snapshots passed to HeapTupleSatisfiesDirty()
  * * snapshots passed to HeapTupleSatisfiesNonVacuumable()
  * * snapshots used for SatisfiesAny, Toast, Self where no members are
  *       accessed.
  *
  * TODO: It's probably a good idea to split this struct using a NodeTag
  * similar to how parser and executor nodes are handled, with one type for
  * each different kind of snapshot to avoid overloading the meaning of
  * individual fields.
  */

> 
>> ------------------------------------------------------------------------
>> jacktby@gmail.com
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-03-05 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-05 14:49 what's hsitoric MVCC Snapshot? jacktby@gmail.com <jacktby@gmail.com>
2023-03-05 15:58 ` Adrian Klaver <adrian.klaver@aklaver.com>
2023-03-05 16:00   ` Adrian Klaver <adrian.klaver@aklaver.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox