-
Knut Anders Hatlen authored
Expressions that match an indexed generated column may be replaced with the generated column in JOIN::optimize(), which enables use of the associated index. Single-table update and delete statements don't have a JOIN data structure, so this optimization is not performed for such statements. This patch changes JOIN::substitute_gc() into a free function, which is used from single-table update and delete statements as well as from JOIN::optimize(). With this change, single-table update and delete statements can use indexes on generated columns for filtering and ordering, even if the statements use the generated column expression instead of an explicit reference to the column.
Knut Anders Hatlen authoredExpressions that match an indexed generated column may be replaced with the generated column in JOIN::optimize(), which enables use of the associated index. Single-table update and delete statements don't have a JOIN data structure, so this optimization is not performed for such statements. This patch changes JOIN::substitute_gc() into a free function, which is used from single-table update and delete statements as well as from JOIN::optimize(). With this change, single-table update and delete statements can use indexes on generated columns for filtering and ordering, even if the statements use the generated column expression instead of an explicit reference to the column.
Loading