The comment: "Used to take no time at all" intrigues me. So ... what happened? I'm guessing something grew in size.
I have two different versions of the program and two different databases that I use for testing.
- I have a copy of the unmodified application Access 2003 FE and its Access 2003 BE.
- I have the modified Access 2003 FE and the SQL Server 2005 BE.
Both of the Database BEs are updated as often as necessary, and kept in synch, that is at any given time, the same version of the production data is in both of them. The updated FE is actually smaller because 1/4 of the queries have been moved to SQL Server Views.
If I run the original version, the Find/Replace is significantly faster than the updated version (I have already given rough statistics).
First, can you rebuild the indexes? If so, does it make a difference?
The SQL Server Admin has already set up and implemented a nightly (M-F) procedure to backup and rebuild the database in preparation for moving to production.
Second, can you change the size of an index record on your BE database? If so, can you try to make the index wide and shallow vs. narrow and deep? The former makes for faster searches but costs more memory. The latter makes for smaller buffer sizes but takes longer to do a search.
Interesting idea, but I am not sure how to do this.
I also have to consider what kind of query the find/replace is building to do this operation. If I were to implement this, I would have the F/R build an Update query once you click the Replace button or the Replace All button. So think about this as a query.
I have no idea, but I suspect that it may be looking over the entire form as opposed to the requested column.
Which leads me to the next issue, a comparison of methods.
Suppose that you are searching table Rabble for all cases where field Rouser contain the word Distims and you want to change that to Graustark. (Don't ask...)
George Barr McCutcheon fan?
UPDATE SET Rabble.Rouser = "Graustark" WHERE Rabble.Rouser = "Distims" ;
Right? This is Find/Replace as a query. (And pardon my sloppy syntax!)
This should run fast.
But what about this one?
UPDATE SET Rabble.Rouser = "Graustark" WHERE Rabble.Rouser LIKE "*Distims*" ;
That one will take LOTS longer because it is a search for any field that CONTAINS the targeted string. So... how many wildcard F/R will you do? That is a case where you might partly or completely negate the effectiveness of the index.
Always, for F/R, think about what the underlying query has to do and test by comparing an equivalent SQL statement.
I am not sure how to respond to this. You make a great point, and I do understand, but I am not in control of the method, MS Access is.
Now... here is where you also are doing yourself dirt. Where is the F/R executed? Inside of Access, I'll bet. Whereas the query, if it is a passthru query, is executed solely on the server and all you get back are the hits, none of the misses. The F/R on the client gets it all, winners and losers alike. So your speed comparisons might be apples/oranges.
I would think that the Find/Receive is in Access, since the command is executed via Control/F. As for Apples and Oranges, I do not think that my users care which kind of fruit comes with lunch, they just want the search speed back.