Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In a previous fix, the the SQL query used by .bvfs_lsdirs was changed to not show empty dirs from accurate jobs. This introduced performance problems when .bvfs_lsdirs was used with larger amounts (hundreds) of folders. This commit changes the SQL query to perform better when using MySQL. Note that it is also necesary to create the following index when using MySQL: CREATE INDEX PathId_JobId_FileNameId_FileIndex ON File(PathId,JobId,FilenameId,FileIndex); When using PostgreSQL create the following partial index: CREATE INDEX file_jpfnidpart_idx ON File(PathId,JobId,FilenameId) WHERE FileIndex = 0; Previously, the SQL Scripts for creating the tables added a single-key index for JobId on the File table. Such an index is not necesary if another multi-key index exists with JobId as the first key. As the number of indexes has a performance impact on INSERT and UPATE, it is a good idea to drop the single-key JobId index when adding the above index. Fixes #837: performance issues with .bvfs_lsdirs while having a large number of directories
- Loading branch information
Showing
3 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters