Re: Inaccuracy in VACUUM's tuple count estimates - Mailing list pgsql-hackers
From | Andres Freund |
---|---|
Subject | Re: Inaccuracy in VACUUM's tuple count estimates |
Date | |
Msg-id | 20140609155723.GC8406@alap3.anarazel.de Whole thread Raw |
In response to | Re: Inaccuracy in VACUUM's tuple count estimates (Kevin Grittner <kgrittn@ymail.com>) |
Responses |
Re: Inaccuracy in VACUUM's tuple count estimates
|
List | pgsql-hackers |
On 2014-06-09 08:00:52 -0700, Kevin Grittner wrote: > I'm not actually sure yet whether the current state of affairs > causes a problem for the serializable transaction isolation level > implementation. I'd replied in the other thread before noticing you'd replied here... From what I understand right now it's not affected at all. I tried to make things a bit clearer there - but I am not sure I've succeed. I'm certainly willing to explain things further if you can tell me which are is unclear. > Right now the HTSV > embedded code comments suggest that the enum names and comments > don't accurately describe the conditions under which they are > returned, but I can't find anything else which does, short of > reverse-engineering that from some fairly complex code. Not really. You could even argue the current code more correctly represents the (old) comments:HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */HEAPTUPLE_DELETE_IN_PROGRESS /* deleting xact is still in progress */ the current code will return INSERT_IN_PROGRESS even if the tuple has *also* been deleted in another xact... I think the problem here is that there's simply no way to really represent that case accurately with the current API. > Perhaps it would be good if you could provide a concise description > of the conditions under which value could currently be returned on > this (or the related) thread before we talk about what changes > might be needed? Maybe this is clear to others involved in the > discussion, but I am not confident that I fully understand what > gets returned under what conditions. HEAPTUPLE_DEAD, /* tuple is dead and deletable */ 1) xmin has committed, xmax has committed and wasn't just a locker. Xmax precedes OldestXmin.HEAPTUPLE_LIVE, /* tuple is live (committed, no deleter) */ 1) xmin has committed, xmax unset 2) xmin has committed, xmax is locked only. Status of xmax is irrelevant 3) xmin has committed, xmax has aborted.HEAPTUPLE_RECENTLY_DEAD, /* tuple is dead, but not deletable yet */ 1) xmin has committed, xmax has committed and wasn't only a locker. But xmax doesn't precede OldestXmin.HEAPTUPLE_INSERT_IN_PROGRESS, /* inserting xact is still in progress */ new: 1) xmin is in progress, xmin is the current backend, xmax is invalid 2) xmin is in progress, xmin is the current backend, xmax only a locker 3) xmin is in progress, xmin is the current backend, xmax aborted 4) xmin is in progress, xmin is *not* current backend, xmax is irrelevant old: 1) xmin is in progress, xmax is invalid 2) xmin is in progress, xmax is only a lockerHEAPTUPLE_DELETE_IN_PROGRESS /* deleting xact is still in progress */ new: 1) xmin has committed, xmax is in progress, xmax is not just a locker 2) xmin is in progress, xmin is the current backend, xmax is not just a locker and in progress. old: 1) xmin has committed, xmax is in progress, xmax is not just a locker 2) xmin is in progress, xmax is set and not not just a locker Note that the 2) case here never checked xmax's status. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services
pgsql-hackers by date: