Re: Page Scan Mode in Hash Index - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Page Scan Mode in Hash Index
Date
Msg-id CAA4eK1KddmY1+5vzwU3qrxDppzLR51oAH2=WoQHhXmL+UUfveA@mail.gmail.com
Whole thread Raw
In response to Re: Page Scan Mode in Hash Index  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: Page Scan Mode in Hash Index  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Mar 27, 2017 at 7:04 PM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:
>
> My guess (which could be wrong) is that so->hashso_bucket_buf =
>> InvalidBuffer should be moved back up higher in the function where it
>> was before, just after the first if statement, and that the new
>> condition so->hashso_bucket_buf == so->currPos.buf on the last
>> _hash_dropbuf() should be removed.  If that's not right, then I think
>> I need somebody to explain why not.
>
> Okay, as i mentioned above, in case of page scan mode we only keep pin
> on a bucket buf. There won't be any case where we will be having pin
> on overflow buf at the end of scan.
>

What if mark the buffer as invalid after releasing the pin?  We are
already doing it that way in btree code, refer
_bt_drop_lock_and_maybe_pin().  I think if we do that way, then we can
do what Robert is suggesting.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Page Scan Mode in Hash Index
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: FDW and parallel execution