1. A computer-implemented method for dynamically partition records in a data set while processing a query, the method comprising: determining a current range size of a set of data records being processed, wherein determining the current range size informs the system how much partitioning has occurred already so that a smaller partition can be selected; determining a new range size for processing records within a resource budget by selecting a range size that is expected to be processable within the resource budget and determining how much additional data can be processed within the resource budget; resizing the current processing range based on the determined new range size, by modifying a clause of a query based on the new range size so that an upper bound of record identifiers is reduced to encompass fewer records in the query; updating a remaining range size to include records excluded from the current range size; and continuing processing the resized current range until either the resource budget is again constrained or all records in the range have been processed.