LCOV - code coverage report
Current view: top level - contrib/bloom - blcost.c (source / functions) Hit Total Coverage
Test: PostgreSQL 13devel Lines: 11 11 100.0 %
Date: 2019-09-19 16:06:56 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-2019, PostgreSQL Global Development Group
       7             :  *
       8             :  * IDENTIFICATION
       9             :  *    contrib/bloom/blcost.c
      10             :  *
      11             :  *-------------------------------------------------------------------------
      12             :  */
      13             : #include "postgres.h"
      14             : 
      15             : #include "fmgr.h"
      16             : #include "utils/selfuncs.h"
      17             : 
      18             : #include "bloom.h"
      19             : 
      20             : /*
      21             :  * Estimate cost of bloom index scan.
      22             :  */
      23             : void
      24          48 : blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
      25             :                Cost *indexStartupCost, Cost *indexTotalCost,
      26             :                Selectivity *indexSelectivity, double *indexCorrelation,
      27             :                double *indexPages)
      28             : {
      29          48 :     IndexOptInfo *index = path->indexinfo;
      30             :     GenericCosts costs;
      31             : 
      32          48 :     MemSet(&costs, 0, sizeof(costs));
      33             : 
      34             :     /* We have to visit all index tuples anyway */
      35          48 :     costs.numIndexTuples = index->tuples;
      36             : 
      37             :     /* Use generic estimate */
      38          48 :     genericcostestimate(root, path, loop_count, &costs);
      39             : 
      40          48 :     *indexStartupCost = costs.indexStartupCost;
      41          48 :     *indexTotalCost = costs.indexTotalCost;
      42          48 :     *indexSelectivity = costs.indexSelectivity;
      43          48 :     *indexCorrelation = costs.indexCorrelation;
      44          48 :     *indexPages = costs.numIndexPages;
      45          48 : }

Generated by: LCOV version 1.13