• Sergey Vojtovich's avatar
    MDEV-7964 - delete_dynamic() takes 0.12% in OLTP RO · c4d2c4e8
    Sergey Vojtovich authored
    delete_dynamic() was called 9-11x per OLTP RO query + 3x per BEGIN/COMMIT.
    
    3 calls were performed by LEX_MASTER_INFO. Added condition to call those only
    for CHANGE MASTER.
    
    1 call was performed by lock_table_names()/Hash_set/my_hash_free(). Hash_set was
    supposed to be used for DDL and LOCK TABLES to gather database names, while it
    was initialized/freed for DML too. In fact Hash_set didn't do any useful job
    here. Hash_set was removed and MDL requests are now added directly to the list.
    
    The rest 5-7 calls are done by optimizer, mostly by Explain_query and friends.
    Since dynamic arrays are used in most cases, they can hardly be optimized.
    
    my_hash_free() overhead dropped 0.02 -> out of radar.
    delete_dynamic() overhead dropped 0.12 -> 0.04.
    c4d2c4e8
sql_lex.h 92 KB