Add a optimize command to mgdb to insert appropriate indexes.