Question about read_stream_look_ahead() - Mailing list pgsql-hackers

From Dilip Kumar
Subject Question about read_stream_look_ahead()
Date
Msg-id CAFiTN-uxyf7qOkOStDbu_WZFOFCXOGkjqNeOiH+V9D1EBHkhyA@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

I was looking into this function, especially this block of code[1], so
what I have noticed is that we always try to combine the sequential
block when the lookahead blocknum is higher than the
pending_read_blocknum, that's fine for ForwardScan.  My question is
should we do something for backward scanning as well?  I mean if we
haven't yet started the I/O then shouldn't we try to merge blocknum
which are smaller than pending_read_blocknum  which would be the
normal case in backward scan.  I mean we would need to change the
start block number in this case though.


[1]
/* Can we merge it with the pending read? */
if (stream->pending_read_nblocks > 0 &&
stream->pending_read_blocknum + stream->pending_read_nblocks == blocknum)
{
stream->pending_read_nblocks++;
continue;
}

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE SCHEMA ... CREATE DOMAIN support
Next
From: vignesh C
Date:
Subject: Re: Skip collecting decoded changes of already-aborted transactions