Doubts about EvalPlanQual

Поиск
Список
Период
Сортировка
От Jacky Leng
Тема Doubts about EvalPlanQual
Дата
Msg-id gniqee$18cb$1@news.hub.org
обсуждение исходный текст
Ответы Re: Doubts about EvalPlanQual  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Hi,

When I read function "EvalPlanQual", I found the following code:
 if (heap_fetch(relation, &SnapshotDirty, &tuple, &buffer, true, NULL)) {  /*   * If xmin isn't what we're expecting,
theslot must have been   * recycled and reused for an unrelated tuple. This implies that   * the latest version of the
rowwas deleted, so we need do   * nothing.  (Should be safe to examine xmin without getting   * buffer's content lock,
sincexmin never changes in an existing   * tuple.)   */  if (!TransactionIdEquals(HeapTupleHeaderGetXmin(tuple.t_data),
       priorXmax))  {   ReleaseBuffer(buffer);   return NULL;  }
 

AFAICS, when Vacuum decides to reclaim any version V of a tuple T, there 
must be none concurrent transactions that are accessing or will access any 
versions before V, because HeapTupleSatisfiesVacuum ensures this.

If I'm right, then my doubt is: how can the branch "if 
(!TransactionIdEquals(HeapTupleHeaderGetXmin(tuple.t_data), priorXmax))" 
happen? Is this a dead branch?

If not, can anyone give an example to explain how does this happen?

Thanks a lot.





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: WIP: hooking parser
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Doubts about EvalPlanQual