#
# dbcheck: eliminate_orphaned_path_records
#
# get all Paths not used by Files or BVFS
#
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 PathHierarchy.PPathId IS NULL
LIMIT 300000
