You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Add some randomness to the choice of which GiST page to insert to.
When descending the tree for an insert, and there are multiple equally goodpages we could insert to, make the choice in random. Previously, we wouldalways choose the tuple with lowest offset number. That meant that when twonon-leaf pages overlap - in the extreme case they might have exactly the samekey - all but the first such page went unused. That wasn't optimal for spaceusage; if you deleted some tuples from the non-first pages, the space wouldnever be reused.With this patch, the other pages are sometimes chosen too, although there'sstill a heavy bias towards low-offset tuples, so that we don't lose cachelocality when doing a lot of inserts with similar keys.Original idea by Alexander Korotkov, although this patch version was writtenby me and copy-edited by Tom Lane.