An application team complains that the DocumentDB cluster takes a long time to return query results.
What can a database specialist use to investigate the query execution plan and analyze the query performance?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: D.
Option A is incorrect because CloudWatch logs do not contain details of DocumentDB query execution plans.
Option B is incorrect because CloudTrail is a log of AWS services API activity.
It cannot be used for monitoring and analyzing the performance of DocumentDB databases.
Option C is incorrect because AWS X-Ray is used for debugging and tracing requests in microservices applications.
Option D is CORRECT because db.runCommand can be used with explain() method to provide a detailed execution plan of a query and provide insight into the query performance.
Reference:
https://docs.aws.amazon.com/documentdb/latest/developerguide/user_diagnostics.html#user_diagnostics-query_planWhen an application team complains about slow query performance in a DocumentDB cluster, a database specialist can use various tools to investigate the query execution plan and analyze the query performance.
Among the given options, the most appropriate tool for this purpose is MongoDB explain() method, which is specifically designed to provide insight into query performance.
The MongoDB explain() method provides a detailed breakdown of how a query is executed, including which indexes are used, how many documents are scanned, and how long each step takes. This information can help the database specialist identify performance bottlenecks and optimize the query.
CloudWatch Logs can be used to monitor the database logs, including slow queries, but it does not provide information on the query execution plan.
CloudTrail Events can help to track the API calls to the DocumentDB cluster, but it does not provide information on the query execution plan.
AWS X-Ray is a debugging and analysis tool that provides end-to-end tracing of requests, but it is designed for distributed applications rather than database queries.
Therefore, the most appropriate option for a database specialist to investigate the query execution plan and analyze the query performance in a DocumentDB cluster is the MongoDB explain() method.