add indices to optimize mysql queries