Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-31 Thread Alexander Korotkov
On Thu, May 31, 2012 at 1:36 PM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > I note that the calculations assume that leaf tuples and internal tuples > have similar sizes. We calculate the average leaf tuple size, and use that > to calculate the fan-out of internal pages. On

Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-31 Thread Heikki Linnakangas
On 29.05.2012 23:46, Alexander Korotkov wrote: On Wed, May 30, 2012 at 12:25 AM, Tom Lane wrote: Alexander Korotkov writes: On Tue, May 29, 2012 at 11:42 PM, Tom Lane wrote: While I'm looking at this, is the first test involving effective_cache_size bulletproof either? In particular, is a

Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-29 Thread Alexander Korotkov
On Wed, May 30, 2012 at 12:25 AM, Tom Lane wrote: > Alexander Korotkov writes: > > On Tue, May 29, 2012 at 11:42 PM, Tom Lane wrote: > >> While I'm looking at this, is the first test involving > >> effective_cache_size bulletproof either? In particular, is > >> avgIndexTuplesPerPage clamped to

Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-29 Thread Tom Lane
Alexander Korotkov writes: > On Tue, May 29, 2012 at 11:42 PM, Tom Lane wrote: >> While I'm looking at this, is the first test involving >> effective_cache_size bulletproof either? In particular, is >> avgIndexTuplesPerPage clamped to be strictly greater than 1? > It's based on collected statis

Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-29 Thread Alexander Korotkov
On Tue, May 29, 2012 at 11:42 PM, Tom Lane wrote: > > While I'm looking at this, is the first test involving > effective_cache_size bulletproof either? In particular, is > avgIndexTuplesPerPage clamped to be strictly greater than 1? > It's based on collected statistics on already inserted tuple

Re: [HACKERS] GiST buffering build, bug in levelStep calculation

2012-05-29 Thread Tom Lane
Heikki Linnakangas writes: > This is because of this rather complex calculation here: >> while ( >> /* subtree must fit in cache (with safety factor of 4) */ >> (1 - pow(avgIndexTuplesPerPage, (double) (levelStep + 1))) / (1 - >> avgIndexTuplesPerPage) < effective_cache_size / 4 >> && >> /* each