diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c
index c08d211..4f4ee66 100644
--- a/src/backend/access/spgist/spgdoinsert.c
+++ b/src/backend/access/spgist/spgdoinsert.c
@@ -598,7 +598,6 @@ checkAllTheSame(spgPickSplitIn *in, spgPickSplitOut *out, bool tooBig,
 				bool *includeNew)
 {
 	int			theNode;
-	int			limit;
 	int			i;
 
 	/* For the moment, assume we can include the new leaf tuple */
@@ -608,23 +607,25 @@ checkAllTheSame(spgPickSplitIn *in, spgPickSplitOut *out, bool tooBig,
 	if (in->nTuples <= 1)
 		return false;
 
-	/* If tuple set doesn't fit on one page, ignore the new tuple in test */
-	limit = tooBig ? in->nTuples - 1 : in->nTuples;
-
 	/* Check to see if more than one node is populated */
 	theNode = out->mapTuplesToNodes[0];
-	for (i = 1; i < limit; i++)
+	for (i = 1; i < in->nTuples; i++)
 	{
 		if (out->mapTuplesToNodes[i] != theNode)
+		{
+			/*
+			 * It's possible that new value are different from all others and
+			 * other values are the same.  We will reserve a node for new 
+			 * value although its pointer could be invalid
+			 */
+			if (tooBig)
+				*includeNew = false;
 			return false;
+		}
 	}
 
 	/* Nope, so override the picksplit function's decisions */
 
-	/* If the new tuple is in its own node, it can't be included in split */
-	if (tooBig && out->mapTuplesToNodes[in->nTuples - 1] != theNode)
-		*includeNew = false;
-
 	out->nNodes = 8;			/* arbitrary number of child nodes */
 
 	/* Random assignment of tuples to nodes (note we include new tuple) */
