A method of processing a stream of data in a database management system, in accordance with a query, the query specifying a defined range of rows in a database table to be accessed, the method comprising:
- performing an initial scan to access the defined range of rows in the database table;
- while performing the initial scan,
- building a list of rows that are added to the database table during the initial scan and that are to be accessed by the scan operator after the initial scan;
- skipping over rows, if any, locked in conflicting modes, the conflicting modes preventing access to the locked rows;
- and
- adding to the list of rows the locked rows skipped during the initial scan;
- performing a secondary scan to access rows in the list, including accessing the rows in the list that are not locked in the conflicting modes;
- and
- while performing the secondary scan, adding to the list of rows additional rows added to the database table after the initial scan.