Pergunta de entrevista da empresa The Graph

How would you deal with a query that has a bad performance?