5 Replies Latest reply on May 30, 2012 10:14 AM by Stephen Huston

    Find getting triggered incorrectly?

    StevenRubenstein

      Today we experienced a significant performance slowdown using both FMP 11 and 10 on a file served by FMS 10.

       

      We're investigating this issue -- that's not the headline.

       

      We noticed, during this slowdown, that a script sending the user to a particular layout was triggering a mysterious and lengthy find -- and we suspect that this find was getting triggered all the time, but that we had never noticed it before when performance was normal. When debugging, we could see that the find was triggered after going to the layout, but the layout has no script triggers. (And we can't "debug" or see the actual find process.) We also created a blank layout for this particular table, and again the find was triggered.

       

      We've isolated the problem to record permissions...for records in a different table.

       

      Here's the question: under what conditions might a find get triggered as the result of account permissions? Here's the calc for the limited view of records in the related table:

       

      Confidential ≠ "Yes"

      or

      PatternCount ( Confidential Access ; LeftWords ( Get ( AccountName ) ; 1 ) & " " & Left(RightWords(Filter(Get(AccountName); "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ")

      ; 1); 1) & "." ) > 0

       

      Also, the find occurs only when the user first goes to the layout. Subsequent visits do not trigger the find, we think.

        • 1. Re: Find getting triggered incorrectly?
          Vaughan

          I believe that Go to Related Records uses finds to perform it's magic. Could the scripts be running GTRR steps?

           

          The finds might be happening alltimes the layout is displayed, but caching might be making all but the first almost instaneous.

          • 2. Re: Find getting triggered incorrectly?
            StevenRubenstein

            Nope.  We've isolated the issue to account permissions -- but we don't know why it's happening, or how to circumvent without giving fuller access.

            • 3. Re: Find getting triggered incorrectly?
              Stephen Huston

              If permissions include Record Level Access settings to make some records completely non-read to certain permissions users, this may be causing a behind-the-scenes internal search to determine which records can be displayed. If such permissions setting involve some interesting (complex or slow) calculations, those have to be evaluated for every record to determine whcih records can remain in the found set to display for the user.

               

              Record Level Access is one of the all-time slowdowns in FileMaker's permissions system.

              • 4. Re: Find getting triggered incorrectly?
                StevenRubenstein

                That makes sense.  But the permissions are for a related table, not the table being displayed.  So why would the find activate?

                • 5. Re: Find getting triggered incorrectly?
                  Stephen Huston

                  Another idea because the file is hosted:

                   

                  As the file is opening, before any OnOpen script or Go to Layout on Opening,  the layout where the file was last closed when used unhosted in single-user mode is actually be referenced even if you cannot see it. If that layout table involves Record Level Access, it may be forcing these evaluations before the opening script and layout triggers are able to be completed.

                   

                  Try taking the file down from the server, open locally as a single user, go to a layout which does not reference any data from a Record Level Access controlled table (not even related calcs which look at such a table). Close the file on that safe layout, being sure that no closing script will change it, then rehost the file.