Fix GIN data page split ratio calculation.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 79ee6370ee803b36c2649cfb7655affa2c1007f1
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2014-09-12T08:28:58Z
Releases: 9.4.0
Fix GIN data page split ratio calculation.

The code that tried to split a page at 75/25 ratio, when appending to the
end of an index, was buggy in two ways. First, there was a silly typo that
caused it to just fill the left page as full as possible. But the logic as
it was intended wasn't correct either, and would actually have given a ratio
closer to 60/40 than 75/25.

Gaetano Mendola spotted the typo. Backpatch to 9.4, where this code was added.

Files

PathChange+/−
src/backend/access/gin/gindatapage.c modified +17 −12