fdb-record-layer
fdb-record-layer copied to clipboard
Aggregate functions should take limits and continuations
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.