예제 #1
0
/*
 * Drops a segment file.
 *
 */ 
static void
AppendOnlyCompaction_DropSegmentFile(Relation aorel,
		int segno)
{
	ItemPointerData persistentTid; 
	int64 persistentSerialNum;

	if (!ReadGpRelationNode(
					aorel->rd_node.relNode,
					segno,
					&persistentTid,
					&persistentSerialNum))
	{
		/* There is nothing to drop */
		return;
	}

	elogif(Debug_appendonly_print_compaction, LOG, 
		"Drop segment file: segno %d", segno);

	MirroredFileSysObj_ScheduleDropAppendOnlyFile(
			&aorel->rd_node,
			segno,
			RelationGetRelationName(aorel),
			&persistentTid,
			persistentSerialNum);

	DeleteGpRelationNodeTuple(aorel, segno);
}
예제 #2
0
/**
 * Drops a segment file.
 *
 */
static void
AOCSCompaction_DropSegmentFile(Relation aorel,
							   int segno)
{
	ItemPointerData persistentTid;
	int64		persistentSerialNum;
	int			pseudoSegNo;
	int			col;

	Assert(RelationIsAoCols(aorel));

	for (col = 0; col < RelationGetNumberOfAttributes(aorel); col++)
	{
		pseudoSegNo = (col * AOTupleId_MultiplierSegmentFileNum) + segno;

		if (!ReadGpRelationNode(
								aorel->rd_rel->reltablespace,
								aorel->rd_rel->relfilenode,
								pseudoSegNo,
								&persistentTid,
								&persistentSerialNum))
		{
			/* There is nothing to drop */
			return;
		}

		elogif(Debug_appendonly_print_compaction, LOG,
			   "Drop segment file: "
			   "segno %d",
			   pseudoSegNo);

		MirroredFileSysObj_ScheduleDropAppendOnlyFile(
													  &aorel->rd_node,
													  pseudoSegNo,
													  RelationGetRelationName(aorel),
													  &persistentTid,
													  persistentSerialNum);

		DeleteGpRelationNodeTuple(aorel,
								  pseudoSegNo);
	}
}