List:Commits« Previous MessageNext Message »
From:U-ROWVWADEjas Date:July 8 2007 9:01pm
Subject:bk commit into 6.0-falcon tree (jas:1.2605)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0-falcon repository of . When  does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-07-08 17:00:36-04:00, jas@rowvwade. +3 -0
  Optimize scan of out of range deferred indexes.

  storage/falcon/DeferredIndex.cpp@stripped, 2007-07-08 17:00:25-04:00, jas@rowvwade. +59 -1
    Optimize scan of out of range deferred indexes.

  storage/falcon/DeferredIndex.h@stripped, 2007-07-08 17:00:25-04:00, jas@rowvwade. +6 -1
    Optimize scan of out of range deferred indexes.

  storage/falcon/ha_falcon.cpp@stripped, 2007-07-08 17:00:25-04:00, jas@rowvwade. +2 -2
    Get rid of unused, unreleased variable to make Valgrind happier.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jas
# Host:	rowvwade.
# Root:	D:/MySQL/mysql-5.1-falcon

--- 1.25/storage/falcon/DeferredIndex.cpp	2007-07-08 17:00:59 -04:00
+++ 1.26/storage/falcon/DeferredIndex.cpp	2007-07-08 17:00:59 -04:00
@@ -69,6 +69,10 @@
 	sizeEstimate = 10;	// How much space this will take in the serial log
 	virtualOffset = 0;
 	virtualOffsetAtEnd = 0;
+	minValue = NULL;
+	maxValue = NULL;
+	haveMinValue = true;
+	haveMaxValue = true;
 }
 
 DeferredIndex::~DeferredIndex(void)
@@ -123,14 +127,20 @@
 	memcpy(node->key, indexKey->key, node->keyLength);
 
 	// Calculate how much space in the serial log this node will take up
+	
 	sizeEstimate += node->keyLength + 4;  // recordNumber + keyLength + key
-
 	DIBucket *buckets[DEFERRED_INDEX_MAX_LEVELS];
 	DIBucket *bucket = (DIBucket*) root;
 	uint slot = 0;
 	int level;
 	//print("Adding", node);
 
+	if (haveMinValue && (minValue == NULL || compare(node, minValue) < 0))
+		minValue = node;
+	
+	if (haveMaxValue && (maxValue == NULL || compare(node, maxValue) > 0))
+		maxValue = node;
+		
 	// Search down index tree for appropriate leaf
 	
 	for (level = levels; level > 0; --level)
@@ -373,6 +383,24 @@
 		
 		if (n == 0)
 			{
+			DINode *node = leaf->nodes[slot];
+			
+			if (node == minValue)
+				{
+				if (slot + 1 < leaf->count)
+					minValue = leaf->nodes[slot + 1];
+				else
+					haveMinValue = false;
+				}
+			
+			if (node == maxValue)
+				{
+				if (slot > 0)
+					maxValue = leaf->nodes[slot - 1];
+				else
+					haveMaxValue = false;
+				}
+
 			--leaf->count;
 			memmove(leaf->nodes + slot, leaf->nodes + slot + 1, (leaf->count - slot) * sizeof(leaf->nodes[0]));
 			--count;
@@ -399,7 +427,13 @@
 	const UCHAR *p1 = node1->key;
 	const UCHAR *p2 = node2->key;
 	uint len = MIN(node1->keyLength, node2->keyLength);
+	const UCHAR *end = p1 + len;
+	
+	while (p1 < end)
+		if (*p1++ != *p2++)
+			return p1[-1] - p2[-1];
 	
+	/***		
 	for (uint l = len; l; --l)
 		{
 		int n = *p1++ - *p2++;
@@ -407,6 +441,7 @@
 		if (n)
 			return n;
 		}
+	***/
 	
 	if (len < node1->keyLength)
 		{
@@ -442,7 +477,13 @@
 	const UCHAR *p1 = node1->key;
 	const UCHAR *p2 = node2->key;
 	uint len = MIN(node1->keyLength, node2->keyLength);
+	const UCHAR *end = p1 + len;
 	
+	while (p1 < end)
+		if (*p1++ != *p2++)
+			return p1[-1] - p2[-1];
+
+	/***	
 	for (uint l = len; l; --l)
 		{
 		int n = *p1++ - *p2++;
@@ -450,6 +491,7 @@
 		if (n)
 			return n;
 		}
+	***/
 	
 	if (partial)
 		return 0;
@@ -699,6 +741,12 @@
 	Sync sync(&syncObject, "DeferredIndex::scanIndex");
 	sync.lock(Shared);
 	
+	if (maxValue && highKey && compare(highKey, maxValue, false) > 0)
+		return;
+	
+	if (minValue && lowKey && compare(lowKey, minValue, false) < 0)
+		return;
+
 	// First, be sure it has not already been put into the serial log.
 
 	if ((virtualOffset < virtualOffsetAtEnd) && !count)
@@ -779,4 +827,14 @@
 
 	Log::debug("Def Index Chill:   trxId=%-5ld indexId=%-7ld  bytes=%8ld  addr=%p  vofs=%llx\n",
 				transaction->transactionId, index->indexId, sizeEstimate, this, virtualOffset);
+}
+
+DINode* DeferredIndex::findMaxValue(void)
+{
+	return NULL;
+}
+
+DINode* DeferredIndex::findMinValue(void)
+{
+	return NULL;
 }

--- 1.19/storage/falcon/DeferredIndex.h	2007-07-08 17:00:59 -04:00
+++ 1.20/storage/falcon/DeferredIndex.h	2007-07-08 17:00:59 -04:00
@@ -97,17 +97,22 @@
 	DeferredIndex	*nextInTransaction;
 	Index			*index;
 	Transaction		*transaction;
-	//DIHunk			initialHunk;
 	DIHunk			*hunks;
+	DINode			*minValue;
+	DINode			*maxValue;
 	UCHAR			initialSpace[500];
 	UCHAR			*base;
 	void			*root;
 	uint			currentHunkOffset;
 	uint			count;
 	int				levels;
+	bool			haveMinValue;
+	bool			haveMaxValue;
 	uint			sizeEstimate;
 	uint64			virtualOffset;		// virtual offset into the serial log where this DI was flushed.
 	uint64			virtualOffsetAtEnd;
+	DINode* findMaxValue(void);
+	DINode* findMinValue(void);
 };
 
 #endif

--- 1.195/storage/falcon/ha_falcon.cpp	2007-07-08 17:00:59 -04:00
+++ 1.196/storage/falcon/ha_falcon.cpp	2007-07-08 17:00:59 -04:00
@@ -60,7 +60,7 @@
 };
 
 static StorageHandler	*storageHandler;
-static NfsPluginHandler *pluginHandler; //cwp
+//static NfsPluginHandler *pluginHandler; //cwp
 
 unsigned long long		falcon_min_record_memory;
 unsigned long long		falcon_max_record_memory; // = 20 * 1024 * 1024;
@@ -157,7 +157,7 @@
 	//timeTest.testScaled(16, 2, 100000);
 	
 	//cwp
-	pluginHandler = new NfsPluginHandler;
+	//pluginHandler = new NfsPluginHandler;
 	
 	DBUG_RETURN(0);
 }
Thread
bk commit into 6.0-falcon tree (jas:1.2605)U-ROWVWADEjas8 Jul