Improved SQL performance on repository homepage