To be sure that it's the find, you could insert a Show Custom Dialog to pop up just before you do the randomizing part of this process.
A frequent culprit for slow finds is to specify find critera in fields that are unstored and thus unindexed. Criteria in related records also slows things down.
It would help if we could see the script that you are using.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
FYI ... Adding the custom dialogue was a great idea. One of the 11 finds is searching a field that is not indexed. The field, "SinceLastSurvey" is a calculation with Unstored number result Get(CurrentDate)-Surveys::c_Survey_Date.
c_Survey_Date is a calculation with stored and indexed date result but from an external table on local drive which may be another reason for the slow execution of this script.
Here's a trick for getting faster results when you need to specify criteria in an indexed field:
Perform a find without specifying that criterion. Then return to find mode, specify this additional criterion and constrain the found set. Since the constrain only works on the records produced by the first find, this almost always results in a much faster find.