Sync slow because of "most recent" MAXROW() virtual column

I looked at the Corporate Dashboard Performance analyzer and it appears that the reason my app is taking almost a minute to sync is a virtual column where I grab the most recent entry for a particular bid item.
Here is the expression:

MAXROW("DailyBidItems", "created_timestamp", AND([bid_item_fk] = [_THISROW].[bid_item_fk], [daily_bid_item_pk] <> [_THISROW].[daily_bid_item_pk]))

I use this to pre-populate fields with the most recent values for things like โ€œpercent complete.โ€ Is there a more efficient way to do this so that the sync time is shorter? Iโ€™ve received complaints from app users regarding the speed of sync.
Thank you!

Solved Solved
0 4 496
1 ACCEPTED SOLUTION

That would very likely improve things, depending on how clustered-together your timestamps are.

If by โ€œnew rowsโ€ you mean โ€œonly as a row is being addedโ€, you can test whether a row is โ€œnew and as of yet unsavedโ€ versus preexisting with this:

ISBLANK(
  FILTER(
    "DailyBidItems"
    ([RowKey] = [_THISROW].[RowKey])
  )
)

replacing RowKey with the name of the tableโ€™s key column. This is a heavier computation than the expression you proposed, but it guarantees to find the one row being added. Compare the performance of each to find the better for your situation.

Another option would be to use a normal (not virtual) column and populate it using an initial value rather than an app formula. This uses storage, but entirely eliminates the recalculation on sync.

View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4

If the VC is only used by some but not all rows, consider wrapping MAXROW() in IFS() with a condition thatโ€™s only true for the rows the VC is used.

itโ€™s only used in new rows. How would that be indicated?
Perhaps something along the lines of, if DATE([created_timestamp]) = TODAY() ?

That would very likely improve things, depending on how clustered-together your timestamps are.

If by โ€œnew rowsโ€ you mean โ€œonly as a row is being addedโ€, you can test whether a row is โ€œnew and as of yet unsavedโ€ versus preexisting with this:

ISBLANK(
  FILTER(
    "DailyBidItems"
    ([RowKey] = [_THISROW].[RowKey])
  )
)

replacing RowKey with the name of the tableโ€™s key column. This is a heavier computation than the expression you proposed, but it guarantees to find the one row being added. Compare the performance of each to find the better for your situation.

Another option would be to use a normal (not virtual) column and populate it using an initial value rather than an app formula. This uses storage, but entirely eliminates the recalculation on sync.

Your solution is accurate to what the purpose of the virtual column is, which is for being used as rows are added, but the performance time is much better using the expression I described. With your solution of heavier computation, sync time was about 12 seconds, but by checking the date, it was brought down to about 6 seconds. My gut wants to do whatโ€™s accurate, but Iโ€™ll stick with the lighter computation as it will suffice for what Iโ€™m doing.
Thanks for your help!

Top Labels in this Space