Pregunta de entrevista de 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.