After some time, the earlier buckets become empty, but the db min still indicates that those progress levels have elements that are better than the smallest item in the heap. Currently, the only way we would retrieve those elements is by running out of heap elements and retrieving from the smallest progress bucket, then processing those, and noticing the results are higher than the db min at that level.
Instead we should check the db minimums for those empty buckets and retrieve from the lowest one if it's sufficiently smaller than the heap minimum. "Sufficiently smaller" could either be a percentage of the heap minimum, of the current limit, or of the remaining time (limit - heap min).
After some time, the earlier buckets become empty, but the db min still indicates that those progress levels have elements that are better than the smallest item in the heap. Currently, the only way we would retrieve those elements is by running out of heap elements and retrieving from the smallest progress bucket, then processing those, and noticing the results are higher than the db min at that level.
Instead we should check the db minimums for those empty buckets and retrieve from the lowest one if it's sufficiently smaller than the heap minimum. "Sufficiently smaller" could either be a percentage of the heap minimum, of the current limit, or of the remaining time (limit - heap min).