Takes forever to recalculate

Viewing 3 reply threads
  • Author
    Posts
  • January 30, 2014 at 4:49 AM #8904

    Philip Tate
    Participant

    I’m calculating elapsed days with the formula ($now – date_field) / 86400
    It works fine the first time, but since it won’t automatically recalculate I edit the field by changing the constant to 86401. Sometimes it works, although it’s slow with approximately 1,000 records, but recently it won’t recalculate at all. It hogs cpu and will spend hours “recalculating.” Multiple times I’ve had to force quit the app, delete the field, and create a new one with the same parameters.I obviously don’t know the inner workings, but it seems that 1,000 calculations should take half a second.

    Update: I ran the four maintenance routines and now it works fine. It recalculates in about fifteen seconds.

    January 30, 2014 at 1:57 PM #8909

    Brendan
    Keymaster

    Hi Philip,

    Whenever you view a record with a $now calculation in it, it should trigger a re-calculation. But I guess that’s not useful if you’re viewing the list of records displaying the results of a calculation there.

    Thanks,

    Brendan

    March 3, 2014 at 3:46 PM #9274

    Philip Tate
    Participant

    I’m still having fits with the recalculate. Maintenance routines sometimes help, and sometimes it still takes very long times (20 – 30 minutes) to do the calculation noted above. I’ve never seen the recalculate take place because of viewing a record.

    March 3, 2014 at 10:48 PM #9276

    Brendan
    Keymaster

    Hi Philip,

    I’ll have to look more closely at my code to see if there are any optimizations I can make. I know you’re not doing this in your formula, but if you reference a calculation field within the formula of another calculation field, then Tap Forms must calculate all the calculation fields within the formula first before it’s able to complete the overall formula. So it can slow it down even more.

    Thanks,

    Brendan

Viewing 3 reply threads

You must be logged in to reply to this topic.