diff options
author | unknown <dlenev@mysql.com> | 2003-12-12 03:39:29 +0300 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2003-12-12 03:39:29 +0300 |
commit | c545b02645cbc09e33a211955a8dbcc09a994b77 (patch) | |
tree | 27e4c621a8cb1797bd140a3d7b363f4e2eb8629c /sql/sql_show.cc | |
parent | 22c12eaeb296b55d6121531bea44a97fb5297f04 (diff) | |
download | mariadb-git-c545b02645cbc09e33a211955a8dbcc09a994b77.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.
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.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index cb6cd18b7c8..1a2f900eb7e 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -213,7 +213,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, else #endif { - if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat.st_mode) || + if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat->st_mode) || (wild && wild_compare(file->name,wild))) continue; } |