1 Answer
- Newest
- Most votes
- Most comments
0
Hi willayd,
The elapsed time is the difference between the end_time and the start_time of the request. It includes the execution, queuing, compilation and planning times.
- Execution: the steps in the query plan are active and being executed. If this phase takes a lot of time, then this means that the queries should be reviewed for optimization, optimization can be at the physical data model level (such as distribution and sort keys) or at the query level (rewriting the query by analyzing the query plan first and then improving its performance). Here are the best practices for designing tables.
- Queuing: the query is on-hold or in other words on the waiting list, waiting for an available slot so it can get executed. This is so often used as an indicator for high number of concurrent queries. This column can be reduced by reviewing the defined workload management and/or enabling the concurrency scaling feature.
- Compilation: the time spent on compiling the execution plan. Usually the first execution includes the overhead of compiling the code and as a result the future runs of the same query will be faster, often even with different parameters (Query planning and execution workflow and compiled code).
- Planning: the time spent on query planning such as query plan rewrite for a faster execution and better performance.
Regards,
Ziad
Relevant content
- asked 3 years ago
- asked 6 months ago
- asked 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 8 months ago
Thanks Ziad for the references. But these numbers have to be cumulative right? So is it:
etc...? Also I think what is ultimately missing from those guides is to how to improve these. In the sample I provided, query 12437 for example seems dominated by Compilation time - but how can that be improved? I don't see anything in those links on how to effect that
Hi willayd,
Elapsed time should be equal or slightly higher than Execution + Queueing + Compilation + Planning. If this is not the case, I recommend opening a support ticket for further analysis. However, Execution is not the sum of Queuing+Compilation+Planning and Queuing is not the sum of Compilation + Planning. Execution, Queuing, Compilation and Planning values are not related to each other, each one of these 4 columns reflects the total time of its appropriate phase. Compilation time should considerably decrease after the first execution. In the above table, the data seems to be misleading, I would recommend you to open a ticket for the support.
Regards,