On Thu, Nov 3, 2016 at 6:25 AM, Amit Kapila <amit.kapil...@gmail.com> wrote: >> + nblkno = _hash_get_newblk(rel, pageopaque); >> >> I think this is not a great name for this function. It's not clear >> what "new blocks" refers to, exactly. I suggest >> FIND_SPLIT_BUCKET(metap, bucket) or OLD_BUCKET_TO_NEW_BUCKET(metap, >> bucket) returning a new bucket number. I think that macro can be >> defined as something like this: bucket + (1 << >> (fls(metap->hashm_maxbucket) - 1)). >> > > I think such a macro would not work for the usage of incomplete > splits. The reason is that by the time we try to complete the split > of the current old bucket, the table half (lowmask, highmask, > maxbucket) would have changed and it could give you the bucket in new > table half.
Can you provide an example of the scenario you are talking about here? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers