pgsql: Fix GIN data page split ratio calculation.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix GIN data page split ratio calculation.
Date: 2014-09-12 08:39:03
Message-ID: E1XSMNj-0004SH-Gb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/774a78ffe47557313d69c2b27e7d61480a3b9d1f

Modified Files
--------------
src/backend/access/gin/gindatapage.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-09-12 14:20:11 pgsql: Support Subject Alternative Names in SSL server certificates.
Previous Message Tom Lane 2014-09-12 03:31:25 pgsql: Fix power_var_int() for large integer exponents.