The idea of being able to off-load time consuming tasks from FileMaker Pro to FileMaker Server is as old as the scripting abilities of FileMaker Pro, which were introduced with the FileMaker Pro 3 release. But it was the FileMaker Server 13 that finally made this idea easy to implement.
This is a fresh story of me spending hours trying to fix a technical issue and accidentally revealing a gold nugget. A few days ago one of my nightly server-side scripts stopped working without any apparent reason. But when I tried to run the script in FileMaker Pro it worked just fine. I really needed a way to debug the script on the server.
This is the first example I was showing in my session Marvelous Optimizations at Pause On Error [x] London 2011. I already wrote about this optimization some time ago. It’s the one that led me to unveil the Marvelous Optimization Formula. I took the example and added FM Bench Detective into it to be able to exactly measure and examine what happens.
Sometimes, not often, I accidentally achieve results that look too marvelous to be real. But they are. Just like in this case. Last week I assigned Petr, our internal system developer, the task to optimize one server-side script. The script recently started taking over 8 hours to run and reaching the expiration limit we have set for it.
I noticed that one of the articles updated in the official FileMaker Knowledge Base on September 23, 2011 was explaining how to select a random set of records in a FileMaker database. I was wondering how fast the currently recommended technique is and whether I can make it faster with the help of FM Bench.
The second example I was showing in my session Marvelous Optimizations at Pause On Error [x] London 2011 was the script for selecting Random Set of Records. I found this example in the FileMaker Knowledge Base and optimized it to run at least 158 times faster when selecting 10 random records out of 50,000.
This example demonstrates that even a single-step script can be optimized. You just have to think a little bit out of the box... I was showing this as a surprise in my session Marvelous Optimizations at Pause On Error [x] London 2011. I used a sample file with 25 fields and 5,000 records and imported these records 5 times in a row in just 13s.