Closed pivnicek closed 5 years ago
We still need to sort the result to know the latest value we fetched :( Otherwise we'd need to sort the (potentially huge) CSV we dumped...
https://travis-ci.com/keboola/db-extractor-mssql/builds/118597841#L2101
So we need to do a separate "max" query to fetch the lastest value. We don't really need to worry about the fact that some new items may have been added in the meantime as those will be removed in the deduplication phase of storage import.
If there's no limit applied on the incremental fetching there is no reason to sort the results.
So https://github.com/keboola/db-extractor-mssql/blob/master/src/Keboola/DbExtractor/Extractor/MSSQL.php#L812 should only be applied if limit != 0