Informix

nested-group-icon.png

DB2

Expand all | Collapse all

syssqltrace time fields

  • 1.  syssqltrace time fields

    Posted Thu January 14, 2021 09:08 AM
    Hi,

    Over syssqltrace table there are some fields about time execution and others, how can I get this values in seconds?
    Thanks for any help.

    Best regards,

    SP

    ------------------------------
    Sergio Peres
    AIRC
    Coimbra
    ------------------------------


  • 2.  RE: syssqltrace time fields

    Posted Thu January 14, 2021 09:16 AM

    dSergio,

     

    depending on which columns you are talking about, but AFAIK these columns are expressed in seconds.xxxxx

     (5 digits after decimal point)

     

    Some other columns are expressed in UTC, but they are not durations, the are timestamps. Use the dbinfo(utc_to_datetime, value) to convert to a timestamp

     

    Is this what you need?

     

     

    Eric Vercelletto
    Data Management Architect and Owner / Begooden IT Consulting
    KandooERP Founder and Community Manager
    IBM Champion 2013,2014,2015,2016,2017,2018,2019,2020
    ibm-champion-rgb-130px

    Tel:     +33(0) 298 51 3210
    Mob : +33(0)626 52 50 68
    skype: begooden-it
    Google Hangout: eric.vercelletto@begooden-it.com
    Email:
    eric.vercelletto@begooden-it.com
    www :
    http://www.vercelletto.com
    www  https://kandooerp.org

     

     






  • 3.  RE: syssqltrace time fields

    Posted Thu January 14, 2021 09:33 AM
    Thanks for reply Eric,

    my doubt is whether the value that appears at sql_runtime is already in seconds or is necessary to convert.

    Cumprimentos,

    SP

    ------------------------------
    Sergio Peres
    AIRC
    Coimbra
    ------------------------------



  • 4.  RE: syssqltrace time fields

    Posted Thu January 14, 2021 09:49 AM
    Sergio:

    Of the "time" columns in syssqltrace, the sql_begintxtime is the internal transaction "time" and not related to a clock time or eleased time.

    The colunm  sql_finishtime contains the UNIX Epoch in seconds which you can convert to a time with dbinfo('utc_to_datetime', sql_finishtime).

    The columns  sql_runtime ,  sql_lockwttime, sql_totaltime ,  sql_avgtime,  sql_maxtime contain fractional elapsed seconds for the query for run time, lock wait time, average run time (when a query has multiple executions), and maximum runtime (when a query has multiple executions) respectively.





    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: syssqltrace time fields

    Posted Thu January 14, 2021 04:20 PM
    Thanks for the information Art,

    My doubt was exactly what kind of values are on those fields.

    Best regards,

    SP

    ------------------------------
    Sergio Peres
    AIRC
    Coimbra
    ------------------------------