From: Teodor Sigaev Date: Fri, 13 Nov 2015 16:43:32 +0000 (+0300) Subject: fix counting in gin_stat for versions >= 9.4 X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=893bc0d7a7fd49acf10f29af990d7c593b406ca6;p=gevel.git fix counting in gin_stat for versions >= 9.4 --- diff --git a/gevel.c b/gevel.c index f0e3738..59bec84 100644 --- a/gevel.c +++ b/gevel.c @@ -739,19 +739,20 @@ processTuple( FuncCallContext *funcctx, GinStatState *st, IndexTuple itup ) { list = GinDataLeafPageGetItems(page, &nlist, minItem); pfree(list); predictNumber = stack->predictNumber; + st->dvalues[1] = Int32GetDatum( predictNumber * nlist ); #elif PG_VERSION_NUM >= 90100 gdi = ginPrepareScanPostingTree(st->index, rootblkno, TRUE); entrybuffer = ginScanBeginPostingTree(gdi); page = BufferGetPage(entrybuffer); predictNumber = gdi->stack->predictNumber; + st->dvalues[1] = Int32GetDatum( predictNumber * GinPageGetOpaque(page)->maxoff ); #else gdi = prepareScanPostingTree(st->index, rootblkno, TRUE); entrybuffer = scanBeginPostingTree(gdi); page = BufferGetPage(entrybuffer); predictNumber = gdi->stack->predictNumber; -#endif - st->dvalues[1] = Int32GetDatum( predictNumber * GinPageGetOpaque(page)->maxoff ); +#endif #if PG_VERSION_NUM < 90400 LockBuffer(entrybuffer, GIN_UNLOCK);