Fixed slow query on /ui/project/X/deployment/Y.