MDEV-6735: Range checked for each record used with key (also MDEV-7786, MDEV-7923)
"Range Checked for Each Record" should be only employed when the other option would be cross-product join (i.e. the other option is so bad that we hardly risk anything). Previous logic was: use RCfER if there are no possible quick selects, or quick select would read > 100 rows. Also, it didn't always work as expected due to range optimizer changing table->quick_keys and us looking at sel->quick_keys. Another angle is that recent versions have enabled use of Join Buffering in e.g. outer joins. This further reduces the range of cases where RCfER should be used. We are still unable to estimate the cost of RCfER with any precision, so now changing the condition of "no quick select or quick->records> 100" to a hopefully better condition "no quick select or quick would cost more than full table scan".
Showing
Please register or sign in to comment