@ -105,6 +105,16 @@ BitmapHeapNext(BitmapHeapScanState *node)
*/
*/
if ( ! node - > initialized )
if ( ! node - > initialized )
{
{
/*
* We can potentially skip fetching heap pages if we do not need any
* columns of the table , either for checking non - indexable quals or
* for returning data . This test is a bit simplistic , as it checks
* the stronger condition that there ' s no qual or return tlist at all .
* But in most cases it ' s probably not worth working harder than that .
*/
node - > can_skip_fetch = ( node - > ss . ps . plan - > qual = = NIL & &
node - > ss . ps . plan - > targetlist = = NIL ) ;
if ( ! pstate )
if ( ! pstate )
{
{
tbm = ( TIDBitmap * ) MultiExecProcNode ( outerPlanState ( node ) ) ;
tbm = ( TIDBitmap * ) MultiExecProcNode ( outerPlanState ( node ) ) ;
@ -743,16 +753,7 @@ ExecInitBitmapHeapScan(BitmapHeapScan *node, EState *estate, int eflags)
scanstate - > shared_tbmiterator = NULL ;
scanstate - > shared_tbmiterator = NULL ;
scanstate - > shared_prefetch_iterator = NULL ;
scanstate - > shared_prefetch_iterator = NULL ;
scanstate - > pstate = NULL ;
scanstate - > pstate = NULL ;
scanstate - > can_skip_fetch = false ;
/*
* We can potentially skip fetching heap pages if we do not need any
* columns of the table , either for checking non - indexable quals or for
* returning data . This test is a bit simplistic , as it checks the
* stronger condition that there ' s no qual or return tlist at all . But in
* most cases it ' s probably not worth working harder than that .
*/
scanstate - > can_skip_fetch = ( node - > scan . plan . qual = = NIL & &
node - > scan . plan . targetlist = = NIL ) ;
/*
/*
* Miscellaneous initialization
* Miscellaneous initialization