fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Aggregate functions should take limits and continuations

Open alecgrieser opened this issue 3 years ago • 0 comments

All of the evaluateAggregateFunction methods on FDBRecordStore (and friends) currently have no limits associated with them, and so they theoretically can do as much work as they want to answer the aggregate function. However, it would seem like these should take ScanProperties to allow them to be limited. If they hit a limit, they should return a ScanProperties that does not have a value but does have a continuation, and you should then be able to take that continuation and provide it to evaluateAggregateFunction to continue the aggregate function calculation.

This could be useful for fixing #7, as the problem specified in that issue is that getSnapshotRecordCount can do unlimited work, which is a special application of this issue.

alecgrieser avatar Apr 09 '21 18:04 alecgrieser