This finding does not point to a problem in the database. It explains an odd number in the profile: negative unaccounted-for time, which comes from the way the operating system measures CPU.
Symptoms
In the Diagnosis, the finding Measured CPU above elapsed time (CPU_ACIMA_DO_DECORRIDO) appears, with a negative percentage of the total time. The text says that it is an effect of the granularity of the CPU measurement in short calls and that it does not indicate a problem in the database, and ends with View in profile.
The finding appears when the unaccounted-for time within calls component is clearly negative. The severity is always low. In the profile, the component appears with a negative value, at the end of the list.
Cause
The unaccounted-for time within a call is the duration (e=) minus the CPU (c=), the waits and the child calls. Duration and CPU come from different operating system measurements, and the CPU one is coarser. In short calls, the error of that measurement can make the CPU larger than the duration; added up over many calls, the result turns negative.
In old traces, with time in hundredths of a second, the effect is larger. The report shows the unit in Time unit, in the Session and environment panel of the Summary.
Resolution
- There is nothing to fix in the database. Read the profile as usual and attack the largest positive component (the method).
- Keep in mind that the CPU in the profile is above the real value by roughly the size of the negative value. If CPU is the largest component, its weight is slightly inflated.
- To check the explanation, see in the latency distribution of the calls, such as FETCH (call duration e), whether most of them fall into the shortest buckets.
How to confirm
Since the finding does not point to a problem, there is no fix to measure. In a new trace of the same operation, the negative value can come back as long as the session makes many short calls. If the operation starts making fewer and longer calls, the value moves closer to zero.
In the report
The sample report does not have this finding: there the component is positive, with 2.3% of the total time. The links open the sections of the example:
- Diagnosis: the finding, with the negative percentage and the View in profile link.
- Profile, unaccounted-for time within calls row: the negative value in Duration (s) and in % of total. The profile text also warns that the negative value comes from the granularity of the CPU measurement.
- Latency distribution of FETCH and of the other calls: how many calls are short.
- Summary: Time unit, in the Session and environment panel.