Re: PATCH: pgbench - break out timing data for initialization phases - Mailing list pgsql-hackers

From Rady, Doug
Subject Re: PATCH: pgbench - break out timing data for initialization phases
Date
Msg-id 6BE48BCE-D5F2-4682-8FE8-CCD47C9C25D9@amazon.com
Whole thread Raw
In response to Re: PATCH: pgbench - break out timing data for initializationphases  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: PATCH: pgbench - break out timing data for initializationphases
Re: PATCH: pgbench - break out timing data for initialization phases
List pgsql-hackers
On 1/29/18, 23:52, "Fabien COELHO" <coelho@cri.ensmp.fr> wrote:
    
    Hello Doug,
Hi Fabien,
    
    > With patch and ‘-I dtgvpf’ options:
    > pgrun pgbench -i -s 2000 -F 90 -q -I dtgvpf
    > dropping old tables...
    > creating tables...
    > generating data...
    > …
    > 200000000 of 200000000 tuples (100%) done (elapsed 168.76 s, remaining 0.00 s)
    > vacuuming...
    > creating primary keys...
    > creating foreign keys...
    > total time: 353.52 s (drop 1.67 s, tables 0.11 s, insert 168.82 s, commit 0.46 s, primary 92.32 s, foreign 40.11
s,vacuum 50.03 s)
 
    > done.
    
    I'm in favor of such a feature.
    
    However, I think that the durations should be shown in the order in which 
    the initialization is performed.

Agreed.
    
    I would suggest to:
    
    - move the time measure in the initialization loop, instead of doing it
      in each function, so that it is done just in one place.

I will do this.
    
    - maybe store the actions in some array/list data structure, eg:
       "{ char * phase; double duration; }", so that they can be kept
       in order and eventually repeated.
    
    In order to extract the commit time, I'd say that explicit begin and 
    commit should be separate instructions triggerred by '(' and ')'.
    
    Also, I'm not sure of the one line display, maybe it could be done while 

The one line display was for ease of parsing it from the output flow.

    it is in progress, i.e. something like:
       dropping table...
       table drop: 1.67 s
       creating table...
       table creation: 0.11 s
       ...
    In which case there is no need for storing the actions and their 
    durations, only the running total is needed.

Doing the "in progress" way suffers from everything before 'generating data' possibly scrolling off the screen/window.
For me, it is much handier to look at one set of duration times all reported together after all of the initialize
phasesare done.
 
    
    -- 
    Fabien.

Thanks!
doug


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Drop --disable-floatN-byval configure options?
Next
From: Andres Freund
Date:
Subject: Weird failures on lorikeet