-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dbcheck orphaned path entries performance issue
A previous commit introduced performance issues when using the bareos-dbcheck orphaned path detection. The underlying SQL query was changed now by using the PathHierarchy table for protecting Path entries used by BVFS.
- Loading branch information
Showing
5 changed files
with
22 additions
and
30 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| # | ||
| # dbcheck: eliminate_orphaned_path_records | ||
| # | ||
| # get all Paths not used by Files | ||
| # and are not substrings to others Paths. | ||
| # get all Paths not used by Files or BVFS | ||
| # | ||
| # LIKE: _% wildcard, but at least one character | ||
| # | ||
| SELECT DISTINCT ParentPath.PathId,File.PathId,ParentPath.Path | ||
| FROM Path AS ParentPath LEFT OUTER JOIN File USING(PathId) | ||
| SELECT DISTINCT Path.PathId, File.PathId, Path.Path | ||
| FROM Path | ||
| LEFT JOIN File USING (PathId) | ||
| LEFT JOIN PathHierarchy ON (Path.Pathid = PathHierarchy.PPathId) | ||
| WHERE File.PathId IS NULL | ||
| AND NOT EXISTS (SELECT 1 FROM Path WHERE Path LIKE ParentPath.Path || '_%%') | ||
| AND PathHierarchy.PPathId IS NULL | ||
| LIMIT 300000 |
This file was deleted.
Oops, something went wrong.
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