In streaming phase, a sys.fn_cdc_map_lsn_to_time() stored procedure is executed for each row. This might be a performance bottleneck.
- We can take advantage of the fact that the stored procedure is called for commitLsn, which, in general, can be the same for many rows. Even having a simple LRU cache which keeps a few entries we can significantly reduce the number of such queries.
- Updating sourceTime can be optional (via configuration).