even though a Layout only displays one field from a table, FileMaker does sent all of the fields of the table.
That may explain the delay. And if on top of that the database is hosted...
creating lots of new records is a great candidate for a PSOS, if your solution is hosted.
"as needed" by you and by FM are two different things
Filemaker won't evaluate an unstored calculation unless it is referenced in some way. Displaying the field on a layout is a common way of referencing it. Other ways are sorting records (and keeping them in an sorted state), conditional formatting, hide conditions, other unstored calcs that reference that calc that *are* displayed, script steps, etc etc. Are you sure none of those things are occurring?
Agreed with David: unstored calcs typically don't get in the way of record creation if there is nothing referencing them. Stored calcs on the other hand...
One typical way of solving the issue is to use a 1x1 table to put the unstored calcs in, that puts the dependency one table down the road.
Thanks to everyone who replied.
BTW The test is done on my mac with a local file.
I just redid a test on a totally empty layout
The script is just a loop of 2000 "New record/request" without any "Set Field"
I ran the script many times until the execution time stabilizes at 3.7 sec each time.
I removed some of my unstored calcs (just the ones used by my dynamic image system)
The script stabilized at 2.8 seconds.
None of the unstored calcs are referenced in any stored field/calc.
I guess I should try to recreate all this on a test file that I could share.
This is puzzling.
I was able to replicate the behavior on a simple database .
click on the "Create records" button a few times and check the avg time.
Edit the table and remove the unstored calcs.
Redo the test and compare the times.
True, but at least I made the script 5% faster by adding
Allow User Abort [Off]
as first 2 lines of the script
That is not a fair comparison
My guess is that unstored calcs do add some bits to the record structure, in the background
so deleting the unstored calcs should be faster
Note: I just tried this using 3 tables in 1 file, and got wildly different times across the 3 tables, so hard to tell how Filemaker is writing the structure in the background
> Edit the table and remove the unstored calcs.
Redo the test and compare the times