diff options
author | dlenev@mysql.com <> | 2003-12-12 03:39:29 +0300 |
---|---|---|
committer | dlenev@mysql.com <> | 2003-12-12 03:39:29 +0300 |
commit | d7ebfbab1c867e15d2a4dc93eb2ccd9316f57abd (patch) | |
tree | 27e4c621a8cb1797bd140a3d7b363f4e2eb8629c /include/my_dir.h | |
parent | fddab846d4f3658b3488cbec43c7d16f07f14594 (diff) | |
download | mariadb-git-d7ebfbab1c867e15d2a4dc93eb2ccd9316f57abd.tar.gz |
Fix for Bug #1952
"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.
Diffstat (limited to 'include/my_dir.h')
-rw-r--r-- | include/my_dir.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/my_dir.h b/include/my_dir.h index 4ccda050914..851b6d8d7e9 100644 --- a/include/my_dir.h +++ b/include/my_dir.h @@ -74,14 +74,21 @@ typedef struct my_stat #endif /* USE_MY_STAT_STRUCT */ -typedef struct fileinfo /* Struct returned from my_dir & my_stat */ +/* Struct describing one file returned from my_dir */ +typedef struct fileinfo { char *name; - MY_STAT mystat; + MY_STAT *mystat; } FILEINFO; typedef struct st_my_dir /* Struct returned from my_dir */ { + /* + These members are just copies of parts of DYNAMIC_ARRAY structure, + which is allocated right after the end of MY_DIR structure (MEM_ROOT + for storing names is also resides there). We've left them here because + we don't want to change code that uses my_dir. + */ struct fileinfo *dir_entry; uint number_off_files; } MY_DIR; |