You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2007/10/31 21:05:44 UTC

svn commit: r590805 - in /db/derby/code/branches/10.1/java/engine/org/apache/derby: iapi/sql/execute/ impl/sql/compile/ impl/sql/execute/

Author: kmarsden
Date: Wed Oct 31 13:05:43 2007
New Revision: 590805

URL: http://svn.apache.org/viewvc?rev=590805&view=rev
Log:
DERBY-766 Modify ResultSetFactory getXXXResultSet methods to not pass in
an
Activation if it is available through a passed in source ResultSet.
Reduces the
amount of code generated for queries.

merge from trunk revision 372692


Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java Wed Oct 31 13:05:43 2007
@@ -209,12 +209,10 @@
      * @param source the result set from which to take rows to be 
      *               updated in the target table.
      * @param vtiRS the updateable result set for the VTI
-     * @param activation the activation for this result set
      * @return the update operation as a result set.
      * @exception StandardException thrown on error
 	 */
-	public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
-                                           Activation activation)
+	public ResultSet getUpdateVTIResultSet(NoPutResultSet source)
         throws StandardException;
 
 	/**
@@ -321,10 +319,6 @@
 
 		@param source the result set from which to take rows to be 
 			filtered by this operation.
-		@param activation the activation for this result set,
-			against whcih the restriction and projection are performed
-			and to which current rows must be assigned for the
-			projection and restriction to be performed.
 		@param singleTableRestriction restriction, if any, applied to
 			input of hash table.
 		@param equijoinQualifiers Qualifier[] for look up into hash table
@@ -352,7 +346,7 @@
 			result set
 	 */
 	public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
-		Activation activation, GeneratedMethod singleTableRestriction, 
+		GeneratedMethod singleTableRestriction, 
 		Qualifier[][] equijoinQualifiers,
 		GeneratedMethod projection, int resultSetNumber,
 		int mapRefItem,
@@ -382,8 +376,6 @@
 		@param distinct true if distinct SELECT list
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -402,7 +394,6 @@
 		boolean distinct, 
 		boolean isInSortedOrder,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -420,8 +411,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderingItem		Ignored to allow same signature as getDistinctScalarAggregateResultSet
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize			Ignored to allow same signature as getDistinctScalarAggregateResultSet
@@ -439,7 +428,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -459,8 +447,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -480,7 +466,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -499,8 +484,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderingItem		Ignored to allow same signature as getDistinctScalarAggregateResultSet
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize			Ignored to allow same signature as getDistinctScalarAggregateResultSet
@@ -517,7 +500,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -536,8 +518,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -556,7 +536,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -704,10 +683,10 @@
 		The rows are put into the hash table on the 1st open.
 		<p>
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the rows from the scan.
 			<verbatim>
@@ -760,9 +739,9 @@
 			result set
 	 */
 	NoPutResultSet getHashScanResultSet(
+			                    Activation activation,
 								long conglomId,
-								int scociItem,
-								Activation activation,
+								int scociItem,						
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -795,10 +774,10 @@
 		the scan.
 		<p>
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the rows from the scan.
 			<verbatim>
@@ -826,9 +805,9 @@
 			result set
 	 */
 	NoPutResultSet getDistinctScanResultSet(
+			                    Activation activation,
 								long conglomId,
-								int scociItem,
-								Activation activation,
+								int scociItem,			
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								int hashKeyColumn,
@@ -908,9 +887,9 @@
 			result set
 	 */
 	NoPutResultSet getTableScanResultSet(
+			                    Activation activation,
 								long conglomId,
 								int scociItem,
-								Activation activation,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -999,9 +978,9 @@
 			result set
 	 */
 	NoPutResultSet getBulkTableScanResultSet(
+			                    Activation activation,
 								long conglomId,
 								int scociItem,
-								Activation activation,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -1033,8 +1012,6 @@
 
 	    @param conglomId	Conglomerate # for the heap.
 		@param scociItem The saved item for the static conglomerate info.
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param source	the source result set, which is expected to provide
 						rows from an index conglomerate
 		@param resultRowAllocator a reference to a method in the activation
@@ -1066,7 +1043,6 @@
 	public NoPutResultSet getIndexRowToBaseRowResultSet(
 								long conglomId,
 								int scoci,
-								Activation a,
 								NoPutResultSet source,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
@@ -1095,8 +1071,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1121,7 +1095,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -1138,8 +1111,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1164,7 +1135,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -1189,8 +1159,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1218,7 +1186,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -1237,8 +1204,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1266,7 +1231,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -1498,10 +1462,10 @@
 		on the scan of its parent table and if the row being deleted
 		on parent table has a reference in the dependent table.
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the result row of the scan.  May
 			be a partial row.
@@ -1558,9 +1522,9 @@
 			result set
 	 */
 	public NoPutResultSet getRaDependentTableScanResultSet(
+			                        Activation activation,
 									long conglomId,
-									int scociItem,
-									Activation activation,
+									int scociItem,							
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java Wed Oct 31 13:05:43 2007
@@ -47,8 +47,8 @@
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.reference.ClassName;
 
-abstract public class BaseJoinStrategy implements JoinStrategy {
-	public BaseJoinStrategy() {
+abstract class BaseJoinStrategy implements JoinStrategy {
+	BaseJoinStrategy() {
 	}
 
 	/** @see JoinStrategy#bulkFetchOK */
@@ -61,7 +61,25 @@
 		return false;
 	}
 
-	protected void fillInScanArgs1(
+	/**
+	 * Push the first set of common arguments for obtaining a scan ResultSet from
+	 * ResultSetFactory.
+	 * The first 11 arguments are common for these ResultSet getters
+	 * <UL>
+	 * <LI> ResultSetFactory.getBulkTableScanResultSet
+	 * <LI> ResultSetFactory.getHashScanResultSet
+	 * <LI> ResultSetFactory.getTableScanResultSet
+	 * <LI> ResultSetFactory.getRaDependentTableScanResultSet
+	 * </UL>
+	 * @param tc
+	 * @param mb
+	 * @param innerTable
+	 * @param predList
+	 * @param acbi
+	 * @param resultRowAllocator
+	 * @throws StandardException
+	 */
+	void fillInScanArgs1(
 								TransactionController tc,
 								MethodBuilder mb,
 								Optimizable innerTable,
@@ -78,9 +96,9 @@
 										getConglomerateNumber();
 		StaticCompiledOpenConglomInfo scoci = tc.getStaticCompiledConglomInfo(conglomNumber);
 		
+		acb.pushThisAsActivation(mb);
 		mb.push(conglomNumber);
 		mb.push(acb.addItem(scoci));
-		acb.pushThisAsActivation(mb);
 
 		acb.pushMethodReference(mb, resultRowAllocator);
 		mb.push(innerTable.getResultSetNumber());
@@ -101,7 +119,7 @@
 		mb.upCast(ClassName.Qualifier + "[][]");
 	}
 
-	protected void fillInScanArgs2(MethodBuilder mb,
+	final void fillInScanArgs2(MethodBuilder mb,
 								Optimizable innerTable,
 								int bulkFetch,
 								int colRefItem,

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java Wed Oct 31 13:05:43 2007
@@ -319,12 +319,11 @@
 		 *  arg2: distinct - true, of course
 		 *  arg3: isInSortedOrder - is the source result set in sorted order
 		 *  arg4: orderItem - entry in saved objects for the ordering
-		 *  arg5: Activation
-		 *  arg6: rowAllocator - method to construct rows for fetching
+		 *  arg5: rowAllocator - method to construct rows for fetching
 		 *			from the sort
-		 *  arg7: row size
-		 *  arg8: resultSetNumber
-		 *  arg9: closeCleanup
+		 *  arg6: row size
+		 *  arg7: resultSetNumber
+		 *  arg8: closeCleanup
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -333,7 +332,6 @@
 		mb.push(true);
 		mb.push(inSortedOrder);
 		mb.push(orderItem);
-		acb.pushThisAsActivation(mb);
 		resultColumns.generateHolder(acb, mb);
 		mb.push(resultColumns.getTotalColumnSize());
 		mb.push(resultSetNumber);
@@ -341,6 +339,6 @@
 		mb.push(costEstimate.getEstimatedCost());
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet", ClassName.NoPutResultSet, 11);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet", ClassName.NoPutResultSet, 10);
 	}
 }

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java Wed Oct 31 13:05:43 2007
@@ -3207,10 +3207,10 @@
 
 		acb.pushGetResultSetFactoryExpression(mb);
 
+     	acb.pushThisAsActivation(mb);
 		mb.push(conglomNumber);
 		mb.push(acb.addItem(scoci));
-      	acb.pushThisAsActivation(mb);
-		resultColumns.generateHolder(acb, mb, referencedCols, (FormatableBitSet) null);
+ 		resultColumns.generateHolder(acb, mb, referencedCols, (FormatableBitSet) null);
 		mb.push(getResultSetNumber());
 		mb.push(hashKeyItem);
 		mb.push(tableDescriptor.getName());

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java Wed Oct 31 13:05:43 2007
@@ -849,7 +849,6 @@
 		mb.push(isInSortedOrder);
 		mb.push(aggInfoItem);
 		mb.push(orderingItem);
-		acb.pushThisAsActivation(mb);
 
 		resultColumns.generateHolder(acb, mb);
 
@@ -896,7 +895,7 @@
 
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet, 12);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet, 11);
 	}
 
 	/**
@@ -926,7 +925,7 @@
 
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet, 11);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet, 10);
 
 	}
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java Wed Oct 31 13:05:43 2007
@@ -270,22 +270,21 @@
 
 		/* Generate the HashTableResultSet:
 		 *	arg1: childExpress - Expression for childResultSet
-		 *  arg2: Activation
-		 *  arg3: searchExpress - Expression for single table predicates
-		 *	arg4	: equijoinExpress - Qualifier[] for hash table look up
-		 *  arg5: projectExpress - Expression for projection, if any
-		 *  arg6: resultSetNumber
-		 *  arg7: mapArrayItem - item # for mapping of source columns
-		 *  arg8: reuseResult - whether or not the result row can be reused
+		 *  arg2: searchExpress - Expression for single table predicates
+		 *	arg3	: equijoinExpress - Qualifier[] for hash table look up
+		 *  arg4: projectExpress - Expression for projection, if any
+		 *  arg5: resultSetNumber
+		 *  arg6: mapArrayItem - item # for mapping of source columns
+		 *  arg7: reuseResult - whether or not the result row can be reused
 		 *						(ie, will it always be the same)
-		 *	arg9: hashKeyItem - item # for int[] of hash column #s
-		 *	arg10: removeDuplicates - don't remove duplicates in hash table (for now)
-		 *	arg11: maxInMemoryRowCount - max row size for in-memory hash table
-		 *	arg12: initialCapacity - initialCapacity for java.util.Hashtable
-		 *	arg13	: loadFactor - loadFactor for java.util.Hashtable
-		 *  arg14: estimated row count
-		 *  arg15: estimated cost
-		 *  arg16: close method
+		 *	arg8: hashKeyItem - item # for int[] of hash column #s
+		 *	arg9: removeDuplicates - don't remove duplicates in hash table (for now)
+		 *	arg10: maxInMemoryRowCount - max row size for in-memory hash table
+		 *	arg11: initialCapacity - initialCapacity for java.util.Hashtable
+		 *	arg12	: loadFactor - loadFactor for java.util.Hashtable
+		 *  arg13: estimated row count
+		 *  arg14: estimated cost
+		 *  arg15: close method
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -324,7 +323,6 @@
 
 		// Get the final cost estimate based on child's cost.
 		costEstimate = childResult.getFinalCostEstimate();
-		acb.pushThisAsActivation(mb);
 
 		// if there is no searchClause, we just want to pass null.
 		if (searchClause == null)
@@ -409,7 +407,7 @@
 		mb.push(costEstimate.getEstimatedCost());
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getHashTableResultSet", ClassName.NoPutResultSet, 16);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getHashTableResultSet", ClassName.NoPutResultSet, 15);
 	}
 
 	/**

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java Wed Oct 31 13:05:43 2007
@@ -212,7 +212,6 @@
 
 		mb.push(heapConglomNumber);
 		mb.push(acb.addItem(scoci));
-		acb.pushThisAsActivation(mb);
 		source.generate(acb, mb);
 		
 		mb.upCast(ClassName.NoPutResultSet);
@@ -267,7 +266,7 @@
 		closeMethodArgument(acb, mb);
 
 		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getIndexRowToBaseRowResultSet",
-						ClassName.NoPutResultSet, 15);
+						ClassName.NoPutResultSet, 14);
 
 		/* The IndexRowToBaseRowResultSet generator is what we return */
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java Wed Oct 31 13:05:43 2007
@@ -1582,7 +1582,6 @@
 		mb.push(leftResultSet.resultColumns.size()); // arg 2
 		rightResultSet.generate(acb, mb); // arg 3
 		mb.push(rightResultSet.resultColumns.size()); // arg 4
-		acb.pushThisAsActivation(mb); // arg 5
 
 		// Get our final cost estimate based on child estimates.
 		costEstimate = getFinalCostEstimate();
@@ -1606,7 +1605,7 @@
 		// if there is no join clause, we just pass a null Expression.
 		if (joinClause == null)
 		{
-		   	mb.pushNull(ClassName.GeneratedMethod); // arg 6
+		   	mb.pushNull(ClassName.GeneratedMethod); // arg 5
 		}
 		else
 		{
@@ -1633,10 +1632,10 @@
 			//	ActivationClass.userExprFun
 			// which is the static field that "points" to the userExprFun
 			// that evaluates the where clause.
-   			acb.pushMethodReference(mb, userExprFun); // arg 6
+   			acb.pushMethodReference(mb, userExprFun); // arg 5
 		}
 
-		mb.push(resultSetNumber); // arg 7
+		mb.push(resultSetNumber); // arg 6
 
 		addOuterJoinArguments(acb, mb);
 
@@ -1697,7 +1696,7 @@
 	 */
 	protected int getNumJoinArguments()
 	{
-		return 12;
+		return 11;
 	}
 
 	/**

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java Wed Oct 31 13:05:43 2007
@@ -366,14 +366,13 @@
 		 *				for distincts
 		 *  arg3: isInSortedOrder - is the source result set in sorted order
 		 *  arg4: orderItem - entry in saved objects for the ordering
-		 *  arg5: Activation
-		 *  arg6: rowAllocator - method to construct rows for fetching
+		 *  arg5: rowAllocator - method to construct rows for fetching
 		 *			from the sort
-		 *  arg7: row size
-		 *  arg8: resultSetNumber
-		 *  arg9: estimated row count
-		 *  arg10: estimated cost
-		 *  arg11: closeCleanup
+		 *  arg6: row size
+		 *  arg7: resultSetNumber
+		 *  arg8: estimated row count
+		 *  arg9: estimated cost
+		 *  arg10: closeCleanup
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -390,8 +389,6 @@
 
 		mb.push(orderItem);
 
-		acb.pushThisAsActivation(mb);
-
 		// row allocator
 		child.getResultColumns().generateHolder(acb, mb);
 
@@ -415,7 +412,7 @@
 		acb.pushResultSetClosedMethodFieldAccess(mb);
 
 		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet",
-							ClassName.NoPutResultSet, 11);
+							ClassName.NoPutResultSet, 10);
 
 	}
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Wed Oct 31 13:05:43 2007
@@ -779,8 +779,7 @@
 
 		/*
 		** Generate the update result set, giving it either the original
-		** source or the normalize result set, the constant action,
-		** and "this".
+		** source or the normalize result set, the constant action.
 		*/
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -789,8 +788,7 @@
         if( null != targetVTI)
         {
 			targetVTI.assignCostEstimate(resultSet.getNewCostEstimate());
-            acb.pushThisAsActivation(mb); // arg 2
-            mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateVTIResultSet", ClassName.ResultSet, 2);
+            mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateVTIResultSet", ClassName.ResultSet, 1);
 		}
         else
         {

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java?rev=590805&r1=590804&r2=590805&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java Wed Oct 31 13:05:43 2007
@@ -181,10 +181,10 @@
 		@see ResultSetFactory#getUpdateVTIResultSet
 		@exception StandardException thrown on error
 	 */
-	public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
-                                           Activation activation)
+	public ResultSet getUpdateVTIResultSet(NoPutResultSet source)
 			throws StandardException
 	{
+		Activation activation = source.getActivation();
 		getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
 		return new UpdateVTIResultSet(source, activation);
 	}
@@ -251,7 +251,7 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
-		Activation activation, GeneratedMethod singleTableRestriction, 
+		GeneratedMethod singleTableRestriction, 
 		Qualifier[][] equijoinQualifiers,
 		GeneratedMethod projection, int resultSetNumber,
 		int mapRefItem,
@@ -266,7 +266,7 @@
 		GeneratedMethod closeCleanup)
 			throws StandardException
 	{
-		return new HashTableResultSet(source, activation, 
+		return new HashTableResultSet(source, source.getActivation(), 
 			singleTableRestriction, 
             equijoinQualifiers,
 			projection, resultSetNumber, 
@@ -290,7 +290,6 @@
 		boolean distinct, 
 		boolean isInSortedOrder,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -303,7 +302,7 @@
 			distinct, 
 			isInSortedOrder,
 			orderItem,
-			activation, 
+			source.getActivation(), 
 			rowAllocator, 
 			maxRowSize,
 			resultSetNumber, 
@@ -320,7 +319,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -331,7 +329,7 @@
 			throws StandardException
 	{
 		return new ScalarAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, activation,
+						source, isInSortedOrder, aggregateItem, source.getActivation(),
 						rowAllocator, resultSetNumber, singleInputRow,
 						optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
@@ -345,7 +343,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -356,7 +353,7 @@
 			throws StandardException
 	{
 		return new DistinctScalarAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, singleInputRow,
 						optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
@@ -370,7 +367,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -380,7 +376,7 @@
 			throws StandardException
 	{
 		return new GroupedAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
 	}
@@ -393,7 +389,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -403,7 +398,7 @@
 			throws StandardException
 	{
 		return new DistinctGroupedAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
 	}
@@ -503,9 +498,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getHashScanResultSet(
+                        			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -573,9 +568,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getDistinctScanResultSet(
+                         			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									int hashKeyColumn,
@@ -618,9 +613,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getTableScanResultSet(
+                        			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -680,9 +675,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getBulkTableScanResultSet(
+                       			    Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -751,7 +746,6 @@
 	public NoPutResultSet getIndexRowToBaseRowResultSet(
 								long conglomId,
 								int scociItem,
-								Activation a,
 								NoPutResultSet source,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
@@ -769,7 +763,7 @@
 		return new IndexRowToBaseRowResultSet(
 								conglomId,
 								scociItem,
-								a,
+								source.getActivation(),
 								source,
 								resultRowAllocator,
 								resultSetNumber,
@@ -793,7 +787,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -805,7 +798,7 @@
 	{
 		return new NestedLoopJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   oneRowRightSide, 
 										   notExistsRightSide, 
@@ -823,7 +816,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -835,7 +827,7 @@
 	{
 		return new HashJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   oneRowRightSide, 
 										   notExistsRightSide, 
@@ -853,7 +845,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -867,7 +858,7 @@
 	{
 		return new NestedLoopLeftOuterJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   emptyRowFun, 
 										   wasRightOuterJoin,
@@ -887,7 +878,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -901,7 +891,7 @@
 	{
 		return new HashLeftOuterJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   emptyRowFun, 
 										   wasRightOuterJoin,
@@ -1145,9 +1135,9 @@
 	 *	@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getRaDependentTableScanResultSet(
+			                        Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,