Skip to content
  • Knut Anders Hatlen's avatar
    e82dacd4
    Bug#22077611: UPDATE .. WHERE JSON_EXTRACT(..) = '..' NOT USING VIRTUAL COL INDEX · e82dacd4
    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.
    e82dacd4
    Bug#22077611: UPDATE .. WHERE JSON_EXTRACT(..) = '..' NOT USING VIRTUAL COL INDEX
    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.
Loading