Unix Technical Forum

advancing snapshot's xmin

This is a discussion on advancing snapshot's xmin within the pgsql Hackers forums, part of the PostgreSQL category; --> Heikki Linnakangas wrote: > Alvaro Herrera wrote: >> Tom Lane wrote: >>> Alvaro Herrera <alvherre@commandprompt.com> writes: >>>> As far ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #21 (permalink)  
Old 04-15-2008, 10:48 PM
Alvaro Herrera
 
Posts: n/a
Default Re: advancing snapshot's xmin

Heikki Linnakangas wrote:
> Alvaro Herrera wrote:
>> Tom Lane wrote:
>>> Alvaro Herrera <alvherre@commandprompt.com> writes:
>>>> As far as I can see, for the purposes of VACUUM we can remove any tuple
>>>> that was deleted after the old transaction's Xid but before that
>>>> transaction's Xmin (i.e. all of its live snapshots). This means we get
>>>> to ignore Xid in GetOldestXmin and in the TransactionXmin calculations
>>>> in GetSnapshotData. It would not surprise me, however, to find out that
>>>> I am overlooking something and this is incorrect.
>>> This seems entirely off-base to me. In particular, if a transaction
>>> has an XID then its XMIN will never be greater than that, so I don't
>>> even see how you figure the case will arise.

>>
>> My point exactly -- can we let the Xmin go past its Xid? You imply we
>> can't, but why?

>
> Everything < xmin is considered to be not running anymore. Other
> transactions would consider the still-alive transaction as aborted, and
> start setting hint bits etc.


Okay. So let's say we invent another TransactionId counter -- we keep
Xmin for the current purposes, and the other counter keeps track of
snapshots ignoring Xid. This new counter could be used by VACUUM to
trim dead tuples.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #22 (permalink)  
Old 04-15-2008, 10:48 PM
Heikki Linnakangas
 
Posts: n/a
Default Re: advancing snapshot's xmin

Alvaro Herrera wrote:
> Heikki Linnakangas wrote:
>> Alvaro Herrera wrote:
>>> Tom Lane wrote:
>>>> Alvaro Herrera <alvherre@commandprompt.com> writes:
>>>>> As far as I can see, for the purposes of VACUUM we can remove any tuple
>>>>> that was deleted after the old transaction's Xid but before that
>>>>> transaction's Xmin (i.e. all of its live snapshots). This means we get
>>>>> to ignore Xid in GetOldestXmin and in the TransactionXmin calculations
>>>>> in GetSnapshotData. It would not surprise me, however, to find out that
>>>>> I am overlooking something and this is incorrect.
>>>> This seems entirely off-base to me. In particular, if a transaction
>>>> has an XID then its XMIN will never be greater than that, so I don't
>>>> even see how you figure the case will arise.
>>> My point exactly -- can we let the Xmin go past its Xid? You imply we
>>> can't, but why?

>> Everything < xmin is considered to be not running anymore. Other
>> transactions would consider the still-alive transaction as aborted, and
>> start setting hint bits etc.

>
> Okay. So let's say we invent another TransactionId counter -- we keep
> Xmin for the current purposes, and the other counter keeps track of
> snapshots ignoring Xid. This new counter could be used by VACUUM to
> trim dead tuples.


Hmm. So if we call that counter VacuumXmin for now, you could remove
deleted rows with xmax < VacuumXmin, as long as that xmax is not in the
set of running transactions? I guess that would work.

In general: VACUUM can remove any tuple that's not visible to any
snapshot in the system. We don't want to keep all snapshots in shared
memory, so we use some conservative approximation of that.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:29 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com