|
-
Aug 18th, 2006, 04:23 AM
#1
Thread Starter
Frenzied Member
What is the most fastest way to see if a string already exists in an array
Anyone know?
Currently I have 25,000 records in a mysql database.
What I am doing right now to see if something exists is the statement..
rs.Open "INSERT INTO yIDs (yID) VALUES ('" & yID & "')", Mysql_Connection
if the string doesnt exist, it is added to the database. if it does, i can tell as an error is raised (since yID is a primary key)
but i need something faster. I need to do about 50 queries a second with different strings, and this method takes a lot of CPU.
Is there a faster way anyone can think of? The ids are ~60 characters long. I need to be able to check if it exists in an array, if not add it.
Would building a string of all the ids on form_load, then using instr be faster?
What about arrays? Dictionary/collection objects? Anything else?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|