From: Bruce Momjian <bruce@momjian.us>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: Rama Krishnan <raghuldrag@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Doubt in mvcc
Date: Wed, 22 Jul 2020 14:32:45 -0400
Message-ID: <20200722183245.GC3899@momjian.us> (raw)
In-Reply-To: <CA+bJJbwpPtVX8bEexmmPu=TEmy2MJCcEGuCvbbQmckSS=F2BOA@mail.gmail.com>
References: <CAJWX+EMdFRBP3995Swt6FWgUvO7mvhAwa+2nBXsTmaWeNaB=jQ@mail.gmail.com>
<CAJWX+EP+gabLLBDExnXhi=JNre=xPRo5REAku7FXR6VZFKBBKg@mail.gmail.com>
<CA+bJJbwpPtVX8bEexmmPu=TEmy2MJCcEGuCvbbQmckSS=F2BOA@mail.gmail.com>
On Mon, Jul 13, 2020 at 10:41:28AM +0200, Francisco Olarte wrote:
> Rama:
>
> On Mon, Jul 13, 2020 at 9:52 AM Rama Krishnan <raghuldrag@gmail.com> wrote:
> > I m preparing for interview one of the recruiter asked me mvcc drawbacks as i told due to mvcc it use more space and need to perform maintenance activity.
> > Another one is the same data causes an update conflict because two different transactions can update the same version of the row.
> > he told its wrong, kindly tell me will you please tell me its correct or wrong?
>
> I'm not sure I understand your question too well, you may want to
> refresh/expand.
>
> One interpretation is, on a pure MVCC contest, two transactions, say 5
> and 6, could try to update a tuple valid for [1,) and end up
> generating two new tuples, [5,), [6,) and closing the original at
> either [1,5) or [1,6) .
>
> That's why MVCC is just a piece, locking is other. On a MVCC the
> tuples are locked while a transaction manipulates them. Other
> transactions may read them, which is why readers do not block writers,
> but two updates on the same tuple serialize.
You might want to look at this:
https://momjian.us/main/presentations/internals.html#mvcc
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bruce@momjian.us, folarte@peoplecall.com, raghuldrag@gmail.com
Subject: Re: Doubt in mvcc
In-Reply-To: <20200722183245.GC3899@momjian.us>
References: <CAJWX+EMdFRBP3995Swt6FWgUvO7mvhAwa+2nBXsTmaWeNaB=jQ@mail.gmail.com> <CAJWX+EP+gabLLBDExnXhi=JNre=xPRo5REAku7FXR6VZFKBBKg@mail.gmail.com> <CA+bJJbwpPtVX8bEexmmPu=TEmy2MJCcEGuCvbbQmckSS=F2BOA@mail.gmail.com> <20200722183245.GC3899@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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