• unknown's avatar
    BUG#15872: Don't run the range analyzer on "t1.keypart NOT IN (const1, ..., )", as that consumes · 15e00f1f
    unknown authored
    too much memory. Instead, either create the equvalent SEL_TREE manually, or create only two ranges that
    strictly include the area to scan
    (Note: just to re-iterate: increasing NOT_IN_IGNORE_THRESHOLD will make optimization run slower for big 
    IN-lists, but the server will not run out of memory. O(N^2) memory use has been eliminated)
    
    
    mysql-test/r/func_in.result:
      Testcase for BUG#15872
    mysql-test/t/func_in.test:
      Testcase for BUG#15872
    sql/item.cc:
      BUG#15872: Added Item_decimal::set_decimal_value()
    sql/item.h:
      UG#15872: Added Item_decimal::set_decimal_value()
    sql/item_cmpfunc.h:
      BUG#15872: Added in_vector::create_item(), in_vector::value_to_item() and their implementations in concrete
      classes.
    sql/opt_range.cc:
      BUG#15872: Don't run the range analyzer on "t1.keypart NOT IN (const1, ..., )", as that 
      consumes too much memory. Instead, either 
       A) create the equivalent SEL_TREE manually, making use of the fact that item_not_in->array
          has an ordered IN-list, or
       B) create only two ranges: (-inf|NULL) < X < min_value_from_in_list,  max_value_from_in_list < X
      (Choose #B if the IN-list has > 10K elements)
    15e00f1f
func_in.test 6.23 KB