SQLite with UITableView 20.000 rows.. Help?
i have SQLite database with 2o columns (name,word). Name it's title of word and Word it's Tags of HTML. my table it's about 20.000 rows. I load my data to TableView, and push it to UIWebView.
My problem, with Searching it's give me  title but when i select to push it to webview give me first row in my table.
for example : first Row Title in name column it's char "a" and in column it's tags of definition word.
Second proplem : when i load my table it's load all database, it's take all memory. 
i need how can i search with require name give me value of in word.
this is my code :

    -(void)loadNames {
	// Path to the database
	NSString* dbPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"PKarabicTH_words.sqlite"];
	NSLog(@"databasePath: %@",dbPath);
	sqlite3 *database;
	NSString *name;
	NSString *word;
    
	// Open the database
	if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
		const char *sql = "SELECT * FROM Arabic";
		sqlite3_stmt *compiledStmt;
		// Fetch all names
		if (sqlite3_prepare_v2(database, sql, -1, &compiledStmt, NULL) == SQLITE_OK) {
			// Append each name
			while (sqlite3_step(compiledStmt) == SQLITE_ROW) {
                
				const char* cName = (char*)sqlite3_column_text(compiledStmt, 1);
				const char* cWord = (char*)sqlite3_column_text(compiledStmt, 2);
				if (cName == NULL)
					// There should not be a NULL name
					NSLog(@"Null name!!");
				else {
					name = [NSString stringWithUTF8String:cName];
					word = [NSString stringWithUTF8String:cWord];
					[names addObject:name];
					[words addObject:word];
					// Apparently the addObject function in NSMutableArray does not
					// keep a copy of our object, so, we can't release it.
					//[name release];
				
                }
                
			}
			sqlite3_finalize(compiledStmt); // Cleanup the statement
		}
		else {
			NSLog(@"Error some worng with data base.");
		}
		sqlite3_close(database);
	}
	else {
		NSLog(@"Error: Can't open database!");
	}
}



    - (void)viewDidLoad
{
    
    [super viewDidLoad];
    names = [[NSMutableArray alloc] init];
	searchedNames = [[NSMutableArray alloc] init];
    words = [[NSMutableArray alloc] initWithCapacity:5];

	[self loadNames];

    
    
}

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    
	return(1);
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    // Return the number of rows in the section.
	
	return [searchedNames count];
    
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    NSString *cellText = [searchedNames objectAtIndex:indexPath.row];
    [cell.textLabel setText:cellText];
    
	cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle= UITableViewCellSelectionStyleBlue;
    return cell;
}

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
}

- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {

}

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
	[searchedNames removeAllObjects];// remove all data that belongs to previous search
	if([searchText isEqualToString:@""] || searchText==nil) {
		// Nothing to search, empty result.
		[myTableView reloadData];
		return;
	}
    
	for (NSString *name in names) {
		NSRange r = [name rangeOfString:searchText options:NSAnchoredSearch];
		if(r.location != NSNotFound) {
			[searchedNames addObject:name];
            

		}
	}


    
    
    [myTableView reloadData];	
}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
}



SQLite with UITableView 20.000 rows.. Help?
===

i have SQLite database with 2o columns (name,word). Name it's title of word and Word it's Tags of HTML. my table it's about 20.000 rows. I load my data to TableView, and push it to UIWebView.
My problem, with Searching it's give me  title but when i select to push it to webview give me first row in my table.
for example : first Row Title in name column it's char "a" and in column it's tags of definition word.
Second proplem : when i load my table it's load all database, it's take all memory. 
i need how can i search with require name give me value of in word.
this is my code :

    -(void)loadNames {
	// Path to the database
	NSString* dbPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"PKarabicTH_words.sqlite"];
	NSLog(@"databasePath: %@",dbPath);
	sqlite3 *database;
	NSString *name;
	NSString *word;
    
	// Open the database
	if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
		const char *sql = "SELECT * FROM Arabic";
		sqlite3_stmt *compiledStmt;
		// Fetch all names
		if (sqlite3_prepare_v2(database, sql, -1, &compiledStmt, NULL) == SQLITE_OK) {
			// Append each name
			while (sqlite3_step(compiledStmt) == SQLITE_ROW) {
                
				const char* cName = (char*)sqlite3_column_text(compiledStmt, 1);
				const char* cWord = (char*)sqlite3_column_text(compiledStmt, 2);
				if (cName == NULL)
					// There should not be a NULL name
					NSLog(@"Null name!!");
				else {
					name = [NSString stringWithUTF8String:cName];
					word = [NSString stringWithUTF8String:cWord];
					[names addObject:name];
					[words addObject:word];
					// Apparently the addObject function in NSMutableArray does not
					// keep a copy of our object, so, we can't release it.
					//[name release];
				
                }
                
			}
			sqlite3_finalize(compiledStmt); // Cleanup the statement
		}
		else {
			NSLog(@"Error some worng with data base.");
		}
		sqlite3_close(database);
	}
	else {
		NSLog(@"Error: Can't open database!");
	}
}



    - (void)viewDidLoad
{
    
    [super viewDidLoad];
    names = [[NSMutableArray alloc] init];
	searchedNames = [[NSMutableArray alloc] init];
    words = [[NSMutableArray alloc] initWithCapacity:5];

	[self loadNames];

    
    
}

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    
	return(1);
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    // Return the number of rows in the section.
	
	return [searchedNames count];
    
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    NSString *cellText = [searchedNames objectAtIndex:indexPath.row];
    [cell.textLabel setText:cellText];
    
	cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle= UITableViewCellSelectionStyleBlue;
    return cell;
}

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
}

- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {

}

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
	[searchedNames removeAllObjects];// remove all data that belongs to previous search
	if([searchText isEqualToString:@""] || searchText==nil) {
		// Nothing to search, empty result.
		[myTableView reloadData];
		return;
	}
    
	for (NSString *name in names) {
		NSRange r = [name rangeOfString:searchText options:NSAnchoredSearch];
		if(r.location != NSNotFound) {
			[searchedNames addObject:name];
            

		}
	}


    
    
    [myTableView reloadData];	
}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
}


