catalyst / moodle-tool_advancedreplace

GNU General Public License v3.0
2 stars 0 forks source link

Make the output file an param so we can output progress bars to the main output #2

Closed brendanheywood closed 2 months ago

brendanheywood commented 2 months ago

If we are doing a search and replace which we expect to take ages we want to get some good eta's and progress bars. We can't easily know how long all the tables will table overall, but we can easily know estimate progress table by tables.

1) replace foo with bar across the site 2) do the 'medium' pre scan to see which tables and columns contain foo and how many times, lets say 20 columns have data out of 200 3) now we have rough heuristic totals of how many records to replace in easy column we can render a progress bar and update it as we grind through records

All this assumes we will end up doing the replace in php, however if we can do it in pure sql then its going to be faster but we also lose visibility of it at the row level. at least in this case we can still have 1 progress bar overall for which table we are processing. Perhaps we could attempt to weight those by a super cheap row count of each table.