Ejemplo n.º 1
0
/* ----------------------------------------------------------------
 *		ExecAppendOnlyReScan
 *
 *		Rescans the relation.
 * ----------------------------------------------------------------
 */
void
ExecAppendOnlyReScan(AppendOnlyScanState *node, ExprContext *exprCtxt)
{
	EState				*estate;
	Index				scanrelid;
	AppendOnlyScanDesc	scan;

	estate = node->ss.ps.state;
	scanrelid = ((AppendOnlyScan *) node->ss.ps.plan)->scan.scanrelid;

	/* If this is re-scanning of PlanQual ... */
	if (estate->es_evTuple != NULL &&
		estate->es_evTuple[scanrelid - 1] != NULL)
	{
		estate->es_evTupleNull[scanrelid - 1] = false;
		return;
	}

	if((node->ss.scan_state & SCAN_SCAN) == 0)
		OpenAOScanRelation(node);

	scan = node->aos_ScanDesc;

	appendonly_rescan(scan,			/* scan desc */
					  NULL);		/* new scan keys */

	Gpmon_M_Incr(GpmonPktFromAppOnlyScanState(node), GPMON_APPONLYSCAN_RESCAN);
	CheckSendPlanStateGpmonPkt(&node->ss.ps);
}
Ejemplo n.º 2
0
void
ReScanAppendOnlyRelation(ScanState *scanState)
{
    Assert(IsA(scanState, TableScanState) ||
           IsA(scanState, DynamicTableScanState));
    AppendOnlyScanState *node = (AppendOnlyScanState *)scanState;
    Assert(node->aos_ScanDesc != NULL);

    appendonly_rescan(node->aos_ScanDesc, NULL /* new scan keys */);
}