From: Teodor Sigaev Date: Mon, 14 May 2012 20:45:37 +0000 (+0400) Subject: fix GiST estimation X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=ae374911b5ca5eab6df18522f9d3ec415b719b9d;p=smlar.git fix GiST estimation --- diff --git a/smlar_gist.c b/smlar_gist.c index ce9c6d8..3520e41 100644 --- a/smlar_gist.c +++ b/smlar_gist.c @@ -1210,7 +1210,7 @@ gsmlsign_consistent(PG_FUNCTION_ARGS) for(i=0; inelems; i++) count += GETBIT(sign, HASHVAL(s->hash[i])); - if ( s->nelems == count || ((double)count) / ((double)(s->nelems)) >= GetSmlarLimit() ) + if ( s->nelems == count || sqrt(((double)count) / ((double)(s->nelems))) >= GetSmlarLimit() ) res = true; } break;