[FX.php List] Showing last related record - sort in FM or just PHP?

Joel Shapiro jsfmp at earthlink.net
Wed Oct 18 10:59:27 MDT 2006


Hi again

REVISED

I've revised the numbers below.  I realized that on my layout using  
the relationship, I still had other related fields (as in my actual  
project), as opposed to just the one calc field that I had on the new  
calc-field layout.  So I removed those other related fields and ran  
those tests again, and the results are much closer to the calc-field  
times than those that I reported yesterday.  With up through 200  
related records, the results are virtually the same.  It is  
interesting to note, still, that using an unstored calc did not prove  
to be slower, as originally anticipated.

And with this, I hereby leave future benchmark testing to others ;-)

-Joel

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Goal:  Display field from last of sorted child records

R = Sorted relationship, related field on layout, using:  end($v 
['REL::field'])
C = Calc field* [unstored], no related field(s) on layout
* for calc field, I tried both:
   = max(REL::numberField) -- unsorted relationship
   = REL::textField -- relationship sorted: descending by text field
   both had similar results

Times are in seconds

Find 1 parent record with 1 child record
R: 2.31127357
C: 2.32556838

Find 1 parent record with 20 child records
R:  2.33943928
C:  2.29863138

Find 1 parent record with 200 child records
R:  2.52557368
C:  2.48299909

Find 1 parent record with 800 child records
R:  3.21900017
C:  2.74986251

Find 4 parent records, each with 200 - 800 child records
R:  4.25035408
C:  3.94424827

Notes:
- times are averages of 6-10 trials each (& incl. 2 sec sleep)
- not optimized (other fields on the layout) but consistent  
throughout (w/ this revision!)
- single development machine running FMSA, FM, browser
- separation model: Web file (no data) and Data file
- match fields: kp_ParentID -< kf_ParentID (in Data file for calc,  
and in Web file)
    (could this have been different if it were a multi-predicate  
relationship?)



On Oct 17, 2006, at 1:31 PM, DC wrote:

> hi joel,
>
> since you have your testing architecture set up already i'd love it  
> if you would take your testing one step further and enlighten us  
> all about this issue since we all seem to be guessing and  
> thumbnailing it and it would be cool to know exactly what the  
> tradeoffs are when you give certain jobs to FMP:
>
> speed comparison between an unstored calc field that plucks off the  
> 'last' record from a relationship and sending related records back  
> through FX.php's XML processing. the test would have to be made  
> with a range of different related record numbers starting at 1  
> related records and maybe going up to 1000.
>
> my assumption is that unstored calc field will be slightly slower  
> when there aren't too many related records, but with many related  
> records, the overhead of processing them in WPE and XML will start  
> to get slow.
>
> my question is at what number of related records does the XML  
> processing go slower than the unstored related calc field?
>
> thanks!
> dan


More information about the FX.php_List mailing list