Timing overhead
In this recipe, we will be discussing overhead of system timing calls.
Getting ready
In general, operating systems maintain a set of clock sources that monotonically increase the time value. When we execute any time-related commands such as date, then the operation system reads the date time value from the underlying hardware clock and then returns the output in human readable format. The clock sources are designed as it should maintain its consistency throughout all of its system time calls. In any case, the clock source should not give us any time value that is in the past. That is, the clock time should be an atomically incremental value. If the clock source loses its consistency due to a bad hardware time keeper, then we also lose the system stability.
While running the EXPLAIN ANALYZE
command, PostgreSQL needs to run multiple system time calls, which keep tracking each node type start and end execution time. When the system loses its consistency in keeping its time value...