[FX.php List] Re-That sinking feeling: FileMaker 12 & FX ?

Joel Shapiro jsfmp at earthlink.net
Wed May 9 16:56:31 MDT 2012


I used to always do separate queries and I tried to keep things non-FM-specific in case a project were to ever move away from FM.

Now, I use portals most of the time.  (And I also use FM scripts at times because for some things they can be a *lot* faster than doing things just through PHP and/or multiple hits to the DB.)

Unless I know there's a real likelihood of a project moving away from FM (which I've never had happen), I now try to take advantage of FM whenever it can speed things up -- whether in development or in performance.

*Sorted* portals will slow things down more than unsorted portals, but it's generally only noticeable when there are *lots* of related records.  And to be fair... I don't know if sorted portals are any slower than having FM sort records before returning the found results.

A couple examples of when I'll *always* use portals:

a) I need to pull a list of records, each of which has related records (e.g people and their phone numbers).  With separate queries, I'd have to loop through each found person and then do a query for that person's related ph#s.  Lots of hits to the DB, instead of just one call to find the people.  (Or, I suppose I could pull *all* phone numbers in just a second query and then loop through everything in PHP to match things up, but that's a lot more work and probably a lot of unused data getting returned -- with no benefit that I can see.)

b) On a login I need to pull lots of different related data for the user.  Putting multiple portals onto the User layout is just one hit to the DB, instead of multiple.


As I think I've mentioned here, I've found that *editing* multiple records is a lot faster when done through a portal on a parent record than multiple edits on each "child" record.  And creating multiple related records is actually way faster when done through an FM script, but I'd probably only use an FM script if I'll need to be adding *lots* of new records at once.

FWIW: I tend to use the API most often on new projects.

Best,
-Joel


On May 9, 2012, at 12:28 PM, Dale Bengston wrote:

> Me too on doing serial FX queries the "SQL way." Makes my code very portable as well.
> 
> On May 9, 2012, at 11:13 AM, Bob Patin wrote:
> 
>> 
>> On May 9, 2012, at 11:11 AM, BEVERLY VOTH wrote:
>> 
>>> No, we were NOT talking about SQL. I just happen to work in both FM and SQL (MS SQL & MySQL) on a daily basis. Since I write the queries, I make them as similar as possible (i.e. no "related fields").
>> 
>> Ah... that makes complete sense. 
>> 



More information about the FX.php_List mailing list