db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r367613 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/db/ impl/sql/catalog/ impl/sql/execute/
Date Tue, 10 Jan 2006 14:34:54 GMT
Author: djd
Date: Tue Jan 10 06:32:13 2006
New Revision: 367613

URL: http://svn.apache.org/viewcvs?rev=367613&view=rev
Log:
Modify some access scans to use the faster fetchNext() rather than separate next() & fetch()
calls.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/ConsistencyChecker.java Tue Jan
10 06:32:13 2006
@@ -308,18 +308,13 @@
 				}
 			
 				/* Get the index rows and count them */
-				for (indexRows = 0; scan.next(); indexRows++)
+				for (indexRows = 0; scan.fetchNext(indexRow.getRowArray()); indexRows++)
 				{
-					RowLocation	baseRL;
-
-					/* Get the index row */
-					scan.fetch(indexRow.getRowArray());
-
 					/*
 					** Get the base row using the RowLocation in the index row,
 					** which is in the last column.  
 					*/
-					baseRL = (RowLocation) indexRow.getColumn(baseColumns + 1);
+					RowLocation baseRL = (RowLocation) indexRow.getColumn(baseColumns + 1);
 
 					boolean base_row_exists = 
 		                baseCC.fetch(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java Tue
Jan 10 06:32:13 2006
@@ -561,10 +561,9 @@
 				TransactionController.MODE_TABLE,
 				TransactionController.ISOLATION_REPEATABLE_READ);
 
-		while ( heapScan.next() )
+		while ( heapScan.fetchNext(heapRow.getRowArray()) )
         {
-            heapScan.fetch( heapRow.getRowArray() );
-			heapScan.fetchLocation( heapLocation );
+ 			heapScan.fetchLocation( heapLocation );
 
 			indexRowGenerator.getIndexRow( heapRow, heapLocation, indexableRow, (FormatableBitSet)
null );
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java Tue Jan
10 06:32:13 2006
@@ -143,12 +143,11 @@
 		 throws StandardException
 	{ 
 		if (sc == null) return null;
-		if (!sc.next())
+		if (!sc.fetchNext(indexRow.getRowArray()))
 		{
 			sc.close();
 			return null;
 		}
-		sc.fetch(indexRow.getRowArray());
 		return indexRow;
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java Tue
Jan 10 06:32:13 2006
@@ -749,9 +749,8 @@
 			heapCC.newRowLocationTemplate(),
 			crf.makeEmptyRow());
 
-		while (drivingScan.next())
+		while (drivingScan.fetchNext(drivingIndexRow.getRowArray()))
 		{
-			drivingScan.fetch(drivingIndexRow.getRowArray());
 			baseRowLocation = (RowLocation)
 						drivingIndexRow.getColumn(drivingIndexRow.nColumns());
 
@@ -895,9 +894,8 @@
 			crf.makeEmptyRow());
 
 		try	{
-			if (drivingScan.next())
+			if (drivingScan.fetchNext(drivingIndexRow.getRowArray()))
 			{
-				drivingScan.fetch(drivingIndexRow.getRowArray());
 				rl[0] = baseRowLocation = (RowLocation)
 					drivingIndexRow.getColumn(drivingIndexRow.nColumns());
 				boolean base_row_exists = 
@@ -1093,10 +1091,8 @@
 			crf.makeEmptyRow());
 
 		int rowNum = 0;
-		while (drivingScan.next())
+		while (drivingScan.fetchNext(drivingIndexRow.getRowArray()))
 		{
-			drivingScan.fetch(drivingIndexRow.getRowArray());
-
 			baseRowLocation = (RowLocation)
 						drivingIndexRow.getColumn(drivingIndexRow.nColumns());
 			boolean base_row_exists = 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
Tue Jan 10 06:32:13 2006
@@ -341,11 +341,10 @@
 	private ExecRow fetchIndexRow()
 		 throws StandardException
 	{ 
-		if (!indexSC.next())
+		if (!indexSC.fetchNext(indexRow.getRowArray()))
 		{
 			return null;
 		}
-		indexSC.fetch(indexRow.getRowArray());
 		return indexRow;
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java
Tue Jan 10 06:32:13 2006
@@ -286,9 +286,8 @@
 		/* Get and return the next row from the temp conglomerate,
 		 * if one exists.
 		 */
-		if (materializedScan != null && materializedScan.next())
+		if (materializedScan != null && materializedScan.fetchNext(materializedRowBuffer.getRowArray()))
 		{
-			materializedScan.fetch(materializedRowBuffer.getRowArray());
 			fetchTCTime += getElapsedMillis(beginTCTime);
 			return materializedRowBuffer;
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java?rev=367613&r1=367612&r2=367613&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
Tue Jan 10 06:32:13 2006
@@ -431,12 +431,11 @@
 	private ExecRow getNextAppendedRow() throws StandardException
 	{
 		if (indexsc == null) return null;
-		if (!indexsc.next())
+		if (!indexsc.fetchNext(indexRow))
 		{
 			return null;
 		}
 		
-		indexsc.fetch(indexRow);
 		RowLocation baseRowLocation =  (RowLocation) indexRow[1];
 		boolean base_row_exists = 
             heapCC.fetch(



Mime
View raw message