Increase performance on sourcestamps queries.

Created four new indexes: branch, revision, project, repository.
Fixes #1729