Don't force the use of a specific DB index
orien opened this issue · 3 comments
We include a work around for a MySQL query optimiser defect
https://github.com/envato/double_entry/blob/master/lib/double_entry/balance_calculator.rb#L42-L48
https://github.com/envato/double_entry/blob/master/lib/double_entry/validation/line_check.rb#L55-L63
This MySQL defect has been patched (in 2010). Is it time to remove the work around?
can we benchmark with and without?
Reading @notahat's comments in the bug report. It doesn't sound deterministic.
Perhaps putting a flip around this is a way forward. Move forward with the change, while allowing a fast way to revert the behaviour if everything goes wrong.
This is not an urgent fix. The index requested is still the appropriate index to use. We don't gain much from doing this work.