• cmiller@zippy.cornsilk.net's avatar
    Backport: · ad181bb0
    cmiller@zippy.cornsilk.net authored
    B-g#27060: SQL Profile utility may not be reporting right duration \
          for each step
    
    Whenever the profiler is reset at the beginning of a query, there's
    a "hidden" profiling entry that represents that point in time.  It 
    has no status description, as those are set by state changes and no
    such point has yet been encountered.  That profiling entry is not
    in the list of entries generated when we change states.
    
    The profiling code had the problem that each step of printing 
    profiling data subtracted the previous "step"'s data, but gave the
    label to that data of the current step, which is wrong.  The label/
    state refers to the period beginning with that profiling data, not
    ending with it.
    
    Now, give a label to the first profiling pseudo-entry, so that we 
    have a name to assign to the period that ends with the first state 
    change.  Now also use the state name of the previous step in showing 
    the delta values that end with this step.
    ad181bb0
sql_profile.cc 23.5 KB