Ejemplo n.º 1
0
void
OutTask(OUTFUNC_ARGS)
{
	WRITE_LOCALS(Task);
	WRITE_NODE_TYPE("TASK");

	WRITE_ENUM_FIELD(taskType, TaskType);
	WRITE_UINT64_FIELD(jobId);
	WRITE_UINT_FIELD(taskId);
	WRITE_STRING_FIELD(queryString);
	WRITE_UINT64_FIELD(anchorShardId);
	WRITE_NODE_FIELD(taskPlacementList);
	WRITE_NODE_FIELD(dependedTaskList);
	WRITE_UINT_FIELD(partitionId);
	WRITE_UINT_FIELD(upstreamTaskId);
	WRITE_NODE_FIELD(shardInterval);
	WRITE_BOOL_FIELD(assignmentConstrained);
	WRITE_NODE_FIELD(taskExecution);
	WRITE_BOOL_FIELD(upsertQuery);
	WRITE_CHAR_FIELD(replicationModel);
	WRITE_BOOL_FIELD(modifyWithSubquery);
	WRITE_NODE_FIELD(relationShardList);
	WRITE_NODE_FIELD(relationRowLockList);
	WRITE_NODE_FIELD(rowValuesLists);
}
Ejemplo n.º 2
0
static void
set_T_IndexOptInfo(DebugGraph *graph, DebugNode *n, PlannerInfo *root,
                   Node *node)
{
    IndexOptInfo *actual_node = (IndexOptInfo*) node;

    /* NB: this isn't a complete set of fields */
    WRITE_OID_FIELD(indexoid);

    WRITE_NODE_FIELD(rel);

    WRITE_UINT_FIELD(indexoid);
    newDebugEdgeByNode(graph, n,
                       getTablespace(graph, actual_node->reltablespace), "reltablespace");

    WRITE_UINT_FIELD(pages);
    WRITE_FLOAT_FIELD(tuples, "%lf");
#	if PG_VERSION_NUM/100 >= 903
    WRITE_INT_FIELD(tree_height);
#	endif
    WRITE_INT_FIELD(ncolumns);
    WRITE_OID_FIELD(relam);
    WRITE_UINT_FIELD(amcostestimate);

    //List	   *indpred;		/* predicate if a partial index, else NIL */
    //List	   *indextlist;		/* targetlist representing index columns */

    WRITE_BOOL_FIELD(reverse_sort);
    WRITE_BOOL_FIELD(nulls_first);
    WRITE_BOOL_FIELD(predOK);
    WRITE_BOOL_FIELD(unique);
    WRITE_BOOL_FIELD(immediate);
    WRITE_BOOL_FIELD(hypothetical);
    WRITE_BOOL_FIELD(canreturn);
}
Ejemplo n.º 3
0
Archivo: outfast.c Proyecto: huor/gpdb
static void
_outIndexOptInfo(StringInfo str, IndexOptInfo *node)
{
	WRITE_NODE_TYPE("INDEXOPTINFO");

	/* NB: this isn't a complete set of fields */
	WRITE_OID_FIELD(indexoid);
	/* Do NOT print rel field, else infinite recursion */
	WRITE_UINT_FIELD(pages);
	WRITE_FLOAT_FIELD(tuples, "%.0f");
	WRITE_INT_FIELD(ncolumns);

	WRITE_INT_ARRAY(opfamily, ncolumns, int);
	WRITE_INT_ARRAY(indexkeys, ncolumns, int);
	WRITE_INT_ARRAY(ordering, ncolumns, int);


    WRITE_OID_FIELD(relam);
	WRITE_OID_FIELD(amcostestimate);
	WRITE_NODE_FIELD(indexprs);
	WRITE_NODE_FIELD(indpred);
	WRITE_BOOL_FIELD(predOK);
	WRITE_BOOL_FIELD(unique);
	WRITE_BOOL_FIELD(amoptionalkey);
	WRITE_BOOL_FIELD(cdb_default_stats_used);
}
Ejemplo n.º 4
0
Archivo: outfast.c Proyecto: huor/gpdb
static void
_outRangeTblEntry(StringInfo str, RangeTblEntry *node)
{
	WRITE_NODE_TYPE("RTE");

	/* put alias + eref first to make dump more legible */
	WRITE_NODE_FIELD(alias);
	WRITE_NODE_FIELD(eref);
	WRITE_ENUM_FIELD(rtekind, RTEKind);

	switch (node->rtekind)
	{
		case RTE_RELATION:
		case RTE_SPECIAL:
			WRITE_OID_FIELD(relid);
			break;
		case RTE_SUBQUERY:
			WRITE_NODE_FIELD(subquery);
			break;
		case RTE_CTE:
			WRITE_STRING_FIELD(ctename);
			WRITE_INT_FIELD(ctelevelsup);
			WRITE_BOOL_FIELD(self_reference);
			WRITE_NODE_FIELD(ctecoltypes);
			WRITE_NODE_FIELD(ctecoltypmods);
			break;
		case RTE_FUNCTION:
			WRITE_NODE_FIELD(funcexpr);
			WRITE_NODE_FIELD(funccoltypes);
			WRITE_NODE_FIELD(funccoltypmods);
			break;
		case RTE_TABLEFUNCTION:
			WRITE_NODE_FIELD(subquery);
			WRITE_NODE_FIELD(funcexpr);
			WRITE_NODE_FIELD(funccoltypes);
			WRITE_NODE_FIELD(funccoltypmods);
			WRITE_BYTEA_FIELD(funcuserdata);
			break;
		case RTE_VALUES:
			WRITE_NODE_FIELD(values_lists);
			break;
		case RTE_JOIN:
			WRITE_ENUM_FIELD(jointype, JoinType);
			WRITE_NODE_FIELD(joinaliasvars);
			break;
        case RTE_VOID:                                                  /*CDB*/
            break;
		default:
			elog(ERROR, "unrecognized RTE kind: %d", (int) node->rtekind);
			break;
	}

	WRITE_BOOL_FIELD(inh);
	WRITE_BOOL_FIELD(inFromCl);
	WRITE_UINT_FIELD(requiredPerms);
	WRITE_OID_FIELD(checkAsUser);

	WRITE_BOOL_FIELD(forceDistRandom);
}
Ejemplo n.º 5
0
Archivo: outfast.c Proyecto: LJoNe/gpdb
static void
_outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
{
	WRITE_NODE_TYPE("CURRENTOFEXPR");

	WRITE_STRING_FIELD(cursor_name);
	WRITE_UINT_FIELD(cvarno);
	WRITE_OID_FIELD(target_relid);
}
Ejemplo n.º 6
0
void
OutShardPlacement(OUTFUNC_ARGS)
{
	WRITE_LOCALS(ShardPlacement);
	WRITE_NODE_TYPE("SHARDPLACEMENT");

	WRITE_UINT64_FIELD(placementId);
	WRITE_UINT64_FIELD(shardId);
	WRITE_UINT64_FIELD(shardLength);
	WRITE_ENUM_FIELD(shardState, RelayFileState);
	WRITE_UINT_FIELD(groupId);
	WRITE_STRING_FIELD(nodeName);
	WRITE_UINT_FIELD(nodePort);
	/* so we can deal with 0 */
	WRITE_INT_FIELD(partitionMethod);
	WRITE_UINT_FIELD(colocationGroupId);
	WRITE_UINT_FIELD(representativeValue);
}
Ejemplo n.º 7
0
void
OutDistributedSubPlan(OUTFUNC_ARGS)
{
	WRITE_LOCALS(DistributedSubPlan);

	WRITE_NODE_TYPE("DISTRIBUTEDSUBPLAN");

	WRITE_UINT_FIELD(subPlanId);
	WRITE_NODE_FIELD(plan);
}
Ejemplo n.º 8
0
Archivo: outfast.c Proyecto: huor/gpdb
static void
_outCurrentOfExpr(StringInfo str, CurrentOfExpr *node)
{
	WRITE_NODE_TYPE("CURRENTOFEXPR");

	WRITE_STRING_FIELD(cursor_name);
	WRITE_UINT_FIELD(cvarno);
	WRITE_OID_FIELD(target_relid);
	WRITE_INT_FIELD(gp_segment_id);
	WRITE_BINARY_FIELD(ctid, sizeof(ItemPointerData));
	WRITE_OID_FIELD(tableoid);
}
Ejemplo n.º 9
0
void
OutTaskExecution(OUTFUNC_ARGS)
{
	WRITE_LOCALS(TaskExecution);
	WRITE_NODE_TYPE("TASKEXECUTION");

	WRITE_UINT64_FIELD(jobId);
	WRITE_UINT_FIELD(taskId);
	WRITE_UINT_FIELD(nodeCount);

	WRITE_ENUM_ARRAY(taskStatusArray, node->nodeCount);
	WRITE_ENUM_ARRAY(transmitStatusArray, node->nodeCount);
	WRITE_INT_ARRAY(connectionIdArray, node->nodeCount);
	WRITE_INT_ARRAY(fileDescriptorArray, node->nodeCount);

	WRITE_INT64_FIELD(connectStartTime);
	WRITE_UINT_FIELD(currentNodeIndex);
	WRITE_UINT_FIELD(querySourceNodeIndex);
	WRITE_UINT_FIELD(failureCount);
	WRITE_BOOL_FIELD(criticalErrorOccurred);
}
Ejemplo n.º 10
0
void
OutGroupShardPlacement(OUTFUNC_ARGS)
{
	WRITE_LOCALS(GroupShardPlacement);
	WRITE_NODE_TYPE("GROUPSHARDPLACEMENT");

	WRITE_UINT64_FIELD(placementId);
	WRITE_UINT64_FIELD(shardId);
	WRITE_UINT64_FIELD(shardLength);
	WRITE_ENUM_FIELD(shardState, RelayFileState);
	WRITE_UINT_FIELD(groupId);
}
Ejemplo n.º 11
0
static void
set_T_RelOptInfo(DebugGraph *graph, DebugNode *n, PlannerInfo *root,
                 Node *node)
{
    RelOptInfo *actual_node = (RelOptInfo*) node;

    addRelids(n, "relids", root, actual_node->relids);
    WRITE_FLOAT_FIELD(rows, "%lf");
    WRITE_INT_FIELD(width);
#	if PG_VERSION_NUM/100 >= 903
    addRelids(n, "lateral_relids", root, actual_node->lateral_relids);
    WRITE_BOOL_FIELD(consider_startup);
#	endif

    WRITE_UINT_FIELD(relid);
    newDebugEdgeByNode(graph, n,
                       getTablespace(graph, actual_node->reltablespace), "reltablespace");
    WRITE_INT_FIELD(rtekind);
    WRITE_FLOAT_FIELD(tuples, "%lf");
    WRITE_FLOAT_FIELD(allvisfrac, "%lf");
    WRITE_UINT_FIELD(pages);

    WRITE_NODE_FIELD(pathlist);
    WRITE_NODE_FIELD(cheapest_startup_path);
    WRITE_NODE_FIELD(cheapest_total_path);
    WRITE_NODE_FIELD(baserestrictinfo);

    WRITE_FLOAT_FIELD(baserestrictcost.startup, "%lf");
    WRITE_FLOAT_FIELD(baserestrictcost.per_tuple, "%lf");

    WRITE_NODE_FIELD(joininfo);
    WRITE_BOOL_FIELD(has_eclass_joins);

    /* pseudo attribute. Is there more than one root per reloptinfo? */
    newDebugEdgeByNode(graph, n, getNode(graph, root, (Node*)root), "_root");
}
Ejemplo n.º 12
0
Archivo: outfast.c Proyecto: huor/gpdb
static void
_outAggref(StringInfo str, Aggref *node)
{
	WRITE_NODE_TYPE("AGGREF");

	WRITE_OID_FIELD(aggfnoid);
	WRITE_OID_FIELD(aggtype);
	WRITE_NODE_FIELD(args);
	WRITE_UINT_FIELD(agglevelsup);
	WRITE_BOOL_FIELD(aggstar);
	WRITE_BOOL_FIELD(aggdistinct);

	WRITE_ENUM_FIELD(aggstage, AggStage);
    WRITE_NODE_FIELD(aggorder);

}
Ejemplo n.º 13
0
static void
_outCustomScan(StringInfo str, CustomScan *node)
{
	WRITE_NODE_TYPE("CUSTOMSCAN");

	_outScanInfo(str, (Scan *) node);

	WRITE_UINT_FIELD(flags);
	WRITE_NODE_FIELD(custom_plans);
	WRITE_NODE_FIELD(custom_exprs);
	WRITE_NODE_FIELD(custom_private);
	WRITE_NODE_FIELD(custom_scan_tlist);
	WRITE_BITMAPSET_FIELD(custom_relids);

	// serialize CustomScanMethods
	WRITE_STRING_FIELD(methods->CustomName);
	WRITE_STRING_FIELD(methods->LibraryName);
	WRITE_STRING_FIELD(methods->SymbolName);
}
Ejemplo n.º 14
0
static void
set_T_PlannerInfo(DebugGraph *graph, DebugNode *n,
                  PlannerInfo *ignored, Node *node)
{
    PlannerInfo *root = (PlannerInfo*) node;
    PlannerInfo *actual_node = (PlannerInfo*) node;

    WRITE_UINT_FIELD(query_level);

    WRITE_NODE_FIELD(parent_root);

    addRelids(n, "all_baserels", root, root->all_baserels);

    WRITE_NODE_FIELD(left_join_clauses);
    WRITE_NODE_FIELD(right_join_clauses);
    WRITE_NODE_FIELD(full_join_clauses);
    WRITE_NODE_FIELD(initial_rels);

    WRITE_FLOAT_FIELD(total_table_pages, "%lf");
    WRITE_FLOAT_FIELD(tuple_fraction, "%lf");
    WRITE_FLOAT_FIELD(limit_tuples, "%lf");
}
Ejemplo n.º 15
0
void
OutMapMergeJob(OUTFUNC_ARGS)
{
	WRITE_LOCALS(MapMergeJob);
	int arrayLength = node->sortedShardIntervalArrayLength;
	int i;

	WRITE_NODE_TYPE("MAPMERGEJOB");

	OutJobFields(str, (Job *) node);
	WRITE_NODE_FIELD(reduceQuery);
	WRITE_ENUM_FIELD(partitionType, PartitionType);
	WRITE_NODE_FIELD(partitionColumn);
	WRITE_UINT_FIELD(partitionCount);
	WRITE_INT_FIELD(sortedShardIntervalArrayLength);

	for (i = 0; i < arrayLength; ++i)
	{
		outNode(str, node->sortedShardIntervalArray[i]);
	}

	WRITE_NODE_FIELD(mapTaskList);
	WRITE_NODE_FIELD(mergeTaskList);
}