Re: accept ... from time



Bottom posting

michael.bierenfeld@xxxxxx wrote:
Hello,

I want to measure the execution time of a sql statement. Can I get the
time in milliseconds to be displayed.

I have

accept START-TIME from time

EXEC SQL SELECT ... something

accept END-TIME from time

DISPLAY "EXECUTION lasted from" START-TIME
DISPLAY " till " END-TIME

START-TIME and END-TIME is pic x(8) this is hh24:mm:ss. But I need
fractions of seconds. How can I do this. Target System is Microfocus
and AIX.

Kind Regards

Michael

As well as the other approaches, you could consider using

EXEC SQL SET :time-variable = CURRENT TIME END-EXEC or similar

As there may be an overhead invoking the DB2 processor, you could run
two such statements in sequence to see what the latent delay is and as
someone else suggested, it would be a good idea to check the
granuarity, perhaps by executing several in sequence, to get an idea of
the "accuracy" (if that's quite the right term) available.

.



Relevant Pages

  • Re: update VFP9 & update SQLServer 2005
    ... a SQL statement should be considered as operating all-at-once, ... assumptions can be made about the sequence of execution of its parts. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: accept ... from time
    ... I want to measure the execution time of a sql statement. ... DISPLAY "EXECUTION lasted from" START-TIME ... 77 t-elapsed-display pic z9.99. ...
    (comp.lang.cobol)
  • Re: CBO & different execution plans
    ... query, ... Oracle 10g generates a non-performant execution plan. ... rows being returned by the SQL statement. ...
    (comp.databases.oracle.server)
  • Re: CBO & different execution plans
    ... a SQL statement in a packaged application that was taking excessively ... long to execute - roughly 3.4 seconds per execution and the packaged ... The problem in this case had to do with Oracle picking ... Providing a hint to Oracle to use ...
    (comp.databases.oracle.server)
  • Re: CBO & different execution plans
    ... a SQL statement in a packaged application that was taking excessively ... long to execute - roughly 3.4 seconds per execution and the packaged ... The problem in this case had to do with Oracle picking ... Providing a hint to Oracle to use ...
    (comp.databases.oracle.server)