Add DB indexes for namespace_id based queries

We should look at the existing project_id based indexes that we have and create equivalent namespace_id ones.

Edited by Heinrich Lee Yu