Re: [HACKERS] GSoC 2017: weekly progress reports (week 6) - Mailing list pgsql-hackers

From Shubham Barai
Subject Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
Date
Msg-id CALxAEPvEUjZ10-uELtoKdebBX-3KPN2Ub=7gJypaf7HQzNjuKg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)
List pgsql-hackers


On 1 October 2017 at 01:47, Alexander Korotkov <a.korotkov@postgrespro.ru> wrote:
On Sat, Sep 30, 2017 at 6:12 PM, Shubham Barai <shubhambaraiss@gmail.com> wrote:
I have made changes according to your suggestions. Please have a look at the updated patch. 
I am also considering your suggestions for my other patches also. But, I will need some time to 
make changes as I am currently busy doing my master's.

I don't understand why sometimes you call PredicateLockPage() only when fast update is off.  For example:

@@ -94,6 +101,9 @@ scanPostingTree(Relation index, GinScanEntry scanEntry,
  break; /* no more pages */
 
  buffer = ginStepRight(buffer, index, GIN_SHARE);
+
+ if (!GinGetUseFastUpdate(index))
+ PredicateLockPage(index, BufferGetBlockNumber(buffer), snapshot);
  }
 
  UnlockReleaseBuffer(buffer);

But sometimes you call PredicateLockPage() unconditionally.

@@ -131,6 +141,8 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
  attnum = scanEntry->attnum;
  attr = btree->ginstate->origTupdesc->attrs[attnum - 1];
 
+ PredicateLockPage(btree->index, stack->buffer, snapshot);
+
  for (;;)
  {
  Page page;

As I understand, all page-level predicate locking should happen only when fast update is off.

Also, despite general idea is described in README-SSI, in-code comments would be useful.

 
Hi Alexander,

Yes, page-level predicate locking should happen only when fast update is off.
Actually, I forgot to put conditions in updated patch. Does everything else look ok ?
 



Kind Regards,
Shubham

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Next
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] why subplan is 10x faster then function?