Commit b84606de authored by mitshel's avatar mitshel
Browse files

Добавлены индексы idx_cat0 on catalogs(cat_name,path) и idx_books_catid on books(cat_id)

Время "холостого" сканирования уменьшилось с 12 до 2х минут
parent 02c82553
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ PRIMARY KEY(book_id),
KEY(filename),
KEY(title,format,filesize),
INDEX(path),
INDEX(cat_id),
INDEX(avail,doublicat),
INDEX(registerdate));
commit;
@@ -36,7 +37,7 @@ cat_name VARCHAR(64),
path VARCHAR(1024),
cat_type INT not null DEFAULT 0,
PRIMARY KEY(cat_id),
KEY(cat_name));
KEY(cat_name,path));
commit;

drop table if exists authors;
+2 −0
Original line number Diff line number Diff line
update dbver set ver="0.18";
create index idx_path on books(path);
create index idx_cat0 on catalogs(cat_name,path);
create index idx_books_catid on books(cat_id);
commit;
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ def processfile(db,fb2,name,full_path,file,archive=0,file_size=0,cat_id=0):
    if e.lower() in extensions_set:
       rel_path=os.path.relpath(full_path,cfg.ROOT_LIB)

       logging.debug("Attempt to add book "+rel_path+" - "+name)
       logging.debug("Attempt to add book "+rel_path+"/"+name)

       fb2.reset()
       if db.findbook(name,rel_path,1)==0: