Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> an easier way to time a sql statement?

an easier way to time a sql statement?

From: DaLoverhino <DaLoveRhino_at_hotmail.com>
Date: 7 Dec 2005 11:34:48 -0800
Message-ID: <1133984087.950197.287460@o13g2000cwo.googlegroups.com>


Hello. If I am writing a select statement and I am concerned about the performance impact, I'll try to time the sql using the following 'technique':

DECLARE
  v_begin_time NUMBER;
  v_end_time NUMBER;
BEGIN
  v_begin_time := DBMS_UTILITY.GET_TIME;   EXECUTE IMMEDIATE '<put select statement here';   v_end_time := DBMS_UTILITY.GET_TIME;

  DBMS_OUTPUT.PUT_LINE( 'Finished in: ' || TO_CHAR( (v_end_time - v_begin_time) / 100 ) || ' seconds.' );
END; I might play around more with the sql statement, and then submit the anonymous block, and do this over again, if need be. I'm wondering if there is an easier way to time a sql statement, since this can be error prone. I was hoping something like:

SELECT /*+ stopwatch */ ...... ;

thanks. Received on Wed Dec 07 2005 - 13:34:48 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US