Search Postgresql Archives

Re: Re: have trouble understanding xmin and xmax with update operations from two different sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 1, 2017 at 8:55 PM, rajan <vgmonnet@xxxxxxxxx> wrote:
Thanks, Jeff. That helps understanding it 50%.

*Session 2* fails to UPDATE the record which is in *(0,2)* and this tuple is
marked for deletion. It means that *(0,2) never exists* when Session 2 is
trying to perform the update.

That it never exists is an appearance presented to the user.  The database system works hard to maintain that illusion but the database system itself sees through the illusion.  It blocks on (0,2) waiting for session 1 to commit, and then once that happens session 2 goes and finds the new version of that row ((0,4) in this case) and locks it.  If you use pageinspect, you can see that (0,2) has left a pointer behind pointing to (0,4) to make it easy to find.
 
Cheers,

Jeff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux