In #153 the --precise queries were chunked to avoid loading the entire DB into memory and thus risking OOM issues.
However, the replacement is happening within each chunk, which breaks the $offset handling, causing every second chunk to be missed. This makes it necessary to run a query multiple times to ensure all occurrences are replaced.
This PR defers the actual updates until after the full search. This is still worse in terms of memory management that completely isolated chunking, but it should still be an overall improvement while making the replacements in a reliable way.
In #153 the
--precise
queries were chunked to avoid loading the entire DB into memory and thus risking OOM issues.However, the replacement is happening within each chunk, which breaks the
$offset
handling, causing every second chunk to be missed. This makes it necessary to run a query multiple times to ensure all occurrences are replaced.This PR defers the actual updates until after the full search. This is still worse in terms of memory management that completely isolated chunking, but it should still be an overall improvement while making the replacements in a reliable way.
Fixes #157