• Oleg Smirnov's avatar
    MDEV-29662 Replace same values in 'IN' list with an equality · 5027cb2b
    Oleg Smirnov authored
    If all elements in the list of 'IN' or 'NOT IN' clause are equal
    and there are no NULLs then clause
    -  "a IN (e1,..,en)" can be converted to "a = e1"
    -  "a NOT IN (e1,..,en)" can be converted to "a <> e1".
    This means an object of Item_func_in can be replaced with an object
    of Item_func_eq for IN (e1,..,en) clause and Item_func_ne for
    NOT IN (e1,...,en). Such a replacement allows the optimizer to choose
    a better execution plan
    5027cb2b
func_in.test 25.3 KB