LCOV - code coverage report
Current view: top level - contrib/bloom - blcost.c (source / functions) Hit Total Coverage
Test: PostgreSQL 13beta1 Lines: 11 11 100.0 %
Date: 2020-06-03 10:06:28 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * blcost.c
       4             :  *      Cost estimate function for bloom indexes.
       5             :  *
       6             :  * Copyright (c) 2016-2020, PostgreSQL Global Development Group
       7             :  *
       8             :  * IDENTIFICATION
       9             :  *    contrib/bloom/blcost.c
      10             :  *
      11             :  *-------------------------------------------------------------------------
      12             :  */
      13             : #include "postgres.h"
      14             : 
      15             : #include "bloom.h"
      16             : #include "fmgr.h"
      17             : #include "utils/selfuncs.h"
      18             : 
      19             : /*
      20             :  * Estimate cost of bloom index scan.
      21             :  */
      22             : void
      23          48 : blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
      24             :                Cost *indexStartupCost, Cost *indexTotalCost,
      25             :                Selectivity *indexSelectivity, double *indexCorrelation,
      26             :                double *indexPages)
      27             : {
      28          48 :     IndexOptInfo *index = path->indexinfo;
      29             :     GenericCosts costs;
      30             : 
      31         432 :     MemSet(&costs, 0, sizeof(costs));
      32             : 
      33             :     /* We have to visit all index tuples anyway */
      34          48 :     costs.numIndexTuples = index->tuples;
      35             : 
      36             :     /* Use generic estimate */
      37          48 :     genericcostestimate(root, path, loop_count, &costs);
      38             : 
      39          48 :     *indexStartupCost = costs.indexStartupCost;
      40          48 :     *indexTotalCost = costs.indexTotalCost;
      41          48 :     *indexSelectivity = costs.indexSelectivity;
      42          48 :     *indexCorrelation = costs.indexCorrelation;
      43          48 :     *indexPages = costs.numIndexPages;
      44          48 : }

Generated by: LCOV version 1.13