Birlasoft interview question

Give a scenario you have optimized a complex query where you were facing challenges to get the proper kpis as per the project requirements.