• unknown's avatar
    Fix for Bug #1952 · f3327cc3
    unknown authored
    "SHOW TABLE STATUS very slow w/large number of tables"
    Replaced old algorithm which were used in my_dir() and stored
    all information about directory entries in one chunk of memory
    with new one which stores file names and MY_STAT structures in
    separate memroot, so now we don't need to copy this data during
    reallocation of dir_entry array.
    
    
    include/my_dir.h:
      Changed mystat member of FILEINFO structure to pointer since 
      this prevents unneeded memory allocation and initialization.
      Added comment about new hidden members of MY_DIR structure.
    mysys/my_lib.c:
      Replaced old algorithm in my_dir() which stored all information
      about directory entries in one chunk of memory with new one 
      which stores file names and MY_STAT structures in separate
      memroot. Now we don't copy this data during reallocation of 
      array with FILEINFO structures.
      Also tuned sizes of memory chunks during first-other
      reallocations (we suppose that we either have < 100 files 
      in the directory or > 1000 of them).
    sql/sql_show.cc:
      Updated only place in code where mystat member
      of FILEINFO structure is used.
    f3327cc3
my_lib.c 17.5 KB