Pergunta de entrevista da empresa FactSet

What optimizations you take for huge queries. How do you log exceptions that occurs while querying the DB? They create alerts on base of any exceptions. so, knowing this is important.