On Fri, Feb 17, 2017 at 7:21 PM, Mithun Cy <mithun...@enterprisedb.com> wrote: > > To implement such an incremental addition of bucket blocks I have to > increase the size of array hashm_spares in meta page by four times. > Also, mapping methods which map a total number of buckets to a > split-point position of hashm_spares array, need to be changed. These > changes create backward compatibility issues. >
How will high and lowmask calculations work in this new strategy? Till now they always work on doubling strategy and I don't see you have changed anything related to that code. Check below places. _hash_metapinit() { .. /* * We initialize the index with N buckets, 0 .. N-1, occupying physical * blocks 1 to N. The first freespace bitmap page is in block N+1. Since * N is a power of 2, we can set the masks this way: */ metap->hashm_maxbucket = metap->hashm_lowmask = num_buckets - 1; metap->hashm_highmask = (num_buckets << 1) - 1; .. } _hash_expandtable() { .. if (new_bucket > metap->hashm_highmask) { /* Starting a new doubling */ metap->hashm_lowmask = metap->hashm_highmask; metap->hashm_highmask = new_bucket | metap->hashm_lowmask; } .. } Till now, we have worked hard for not changing the page format in a backward incompatible way, so it will be better if we could find some way of doing this without changing the meta page format in a backward incompatible way. Have you considered to store some information in shared memory based on which we can decide how much percentage of buckets are allocated in current table half? I think we might be able to construct this information after crash recovery as well. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers