On Mon, 2006-12-04 at 21:46 -0500, Tom Lane wrote:
> Jeff Davis <pgsql@j-davis.com> writes:
> > Since I am not storing any pointers, and since the information is only
> > really a hint, I don't need to do any locking on that page.
>
> If you think that, you need not bother to submit the patch. (Hint:
> as soon as you consider more than one table at a time, it doesn't work,
> even ignoring the question of inconsistent reads.)
>
I believe I accounted for that case correctly. In the unlikely event
that it gets a wrong hint value from the table, it would either:
(1) See that the value is larger than rs_nblocks and start from 0 like
normal
(2) Not know that the value is wrong because it is a valid block for
that relation, and it would use it anyway.
In the case of #2, everything should be fine, because an arbitrary value
is no worse than the arbitrary value of 0 we use right now.
I could always store the Oid in the table also, so that #2 wouldn't
happen unless the table was truncated (by TRUNCATE, CLUSTER, or VACUUM
FULL) after a scan.
Regards,Jeff Davis