6 Replies Latest reply on Apr 13, 2016 9:10 AM by sfpx

    Record creation speed and occurrences

    sfpx

      One thing I don't like about Filemaker is that record creation is highly impacted by the number of occurrences.

      I'm doing some tests to find a way to speed up my initial sync script ( a lot of records have to be created on an initial sync).

      Here's my latest test on a simple database

      speed.jpg

       

      Creating 20000 records of table B (1 occurrence of B) : 14 seconds

      Creating 20000 records of table D (6 occurrences of D): 21 seconds

      Creating 20000 records of table F (6 occurrences of F): 15 sec

       

      What can explain this ?

       

      Notes:

      Tables B, D and F are identical copies.

      The script is a loop that simply creates 20000 records and set the "_id" field to "x"

        • 1. Re: Record creation speed and occurrences
          RickWhitelaw

          I don't think the times have anything to do with the number of occurrences. Otherwise why isn't D the same as F? Why would a sync script create records? Perhaps it would be better to ask what you mean exactly by "sync script".

          • 2. Re: Record creation speed and occurrences
            sfpx

            RickWhitelaw wrote:

             

            Why would a sync script create records? Perhaps it would be better to ask what you mean exactly by "sync script".

             

            I'm talking about a script that writes records from a server to a mobile device for offline use.

            RickWhitelaw wrote:

             

            I don't think the times have anything to do with the number of occurrences. Otherwise why isn't D the same as F?

            That was my question

            You are right, it's not simply the number of occurrences but the number of occurrences that are linked to other occurrences of the same table.

             

            In the example above, each occurrence of D is linked to the other occurrences of D via the C occurrence and this has quite an impact on performance.

            • 3. Re: Record creation speed and occurrences
              Mike_Mitchell

              Because the relationships have to be refreshed as a new record is created. They're cached, and that cache has to be updated.

              • 4. Re: Record creation speed and occurrences
                sfpx

                Why is it slower to refresh the C-D relations than it is to refresh the E-F relations ?

                 

                Is there a way to avoid this ?

                I guess that the Filemaker "Import records" function only refreshes the relations once after the end of the operation ? (It's way faster than a loop script)

                 

                Is there a way to tell FM to avoid refreshing the relations inside a loop...some sort of transactional operation ?

                • 5. Re: Record creation speed and occurrences
                  Mike_Mitchell

                  sfpx wrote:

                   

                  Why is it slower to refresh the C-D relations than it is to refresh the E-F relations ?

                   

                   

                  I can't say for certain, but I suspect it's because there are many more relationships involved. All paths between the different TOs have to be evaluated. Count up the total number of paths and it'll probably make more sense.

                   

                  Is there a way to tell FM to avoid refreshing the relations inside a loop...some sort of transactional operation ?

                   

                  Yes, you can run a transactional script. The basic idea is to create / modify the records through a portal and then only commit when you're done. That way, not only do you benefit from a possible performance boost, you can error trap the operation and revert the record if something goes wrong - restoring the parent record and all children to their original state. You can do a search on this forum or on Google for "transactional FileMaker". There are lots of resources out there on it.

                  1 of 1 people found this helpful