Beispiel #1
0
/*
 * Prepares the BitmapTableScanState for a re-scan.
 */
void
ExecBitmapTableReScan(BitmapTableScanState *node, ExprContext *exprCtxt)
{
	BitmapTableScanReScan(node, exprCtxt);
	/*
	 * Always rescan the input immediately, to ensure we can pass down any
	 * outer tuple that might be used in index quals.
	 */
	Gpmon_M_Incr(GpmonPktFromBitmapTableScanState(node), GPMON_BITMAPTABLESCAN_RESCAN);
	CheckSendPlanStateGpmonPkt(&node->ss.ps);
	ExecReScan(outerPlanState(node), exprCtxt);
}
/*
 * Retrieves the next tuple from the BitmapTableScan's underlying relation.
 */
TupleTableSlot *
ExecBitmapTableScan(BitmapTableScanState *node)
{
	ScanState *scanState = (ScanState *)node;

	TupleTableSlot *slot = DynamicScan_GetNextTuple(scanState, BitmapTableScanBeginPartition,
			BitmapTableScanEndPartition, BitmapTableScanReScanPartition, BitmapTableScanFetchNext);

	if (!TupIsNull(slot))
	{
		Gpmon_Incr_Rows_Out(GpmonPktFromBitmapTableScanState(node));
		CheckSendPlanStateGpmonPkt(&scanState->ps);
	}
	else if (!scanState->ps.delayEagerFree)
	{
		ExecEagerFreeBitmapTableScan(node);
	}

	return slot;
}