Here's a version of the patch I've been working on. There's no functional changes, just a lot of moving things around, comment changes, etc. to hopefully make it more readable.
Thanks for your work on this patch. Patch with comment is attached.
Thanks, I incorporated that, and did a lot of other comment changes. I included the example you gave earlier on how the first phase of the algorithm works, in a comment. Please review, and if you have some test cases at hand, run them. I think this is ready for commit now.
Comments looks good, thanks. I'm going to try also some datasets from rtreeportal.org
Why "maxoff + 2" ? Allocating a few extra bytes is obviously harmless, but I wonder if it was just a leftover from something.
It was nested from old code. This extra bytes are useless in modern versions of PostgreSQL as we found while seg picksplit patch discussion. Modern version of seg picksplit doesn't contain them: