reduce number of queries in file list