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 -> Re: measuring the sql time to execute

Re: measuring the sql time to execute

From: Jay Weiland <jay_at_pixar.com>
Date: Tue, 24 Aug 1999 11:32:45 -0700
Message-ID: <37C2E54D.9B3ED399@pixar.com>


Larry,

      This is a script I like to run from sql*plus. Mind you, the count(*) operation might add a few hundredths of a second.

Jay!!!

DECLARE
   time_before BINARY_INTEGER;
   time_after BINARY_INTEGER;
   foo INTEGER;
BEGIN
   time_before := DBMS_UTILITY.GET_TIME;

   SELECT count(*)

     INTO foo
     FROM ( [Your select statement here] );

   time_after := DBMS_UTILITY.GET_TIME;    DBMS_OUTPUT.PUT_LINE (
     (time_after - time_before) / 100 || ' seconds'); END;
/

Larry Pettit wrote:

> Is there a way to run sql commands and record the time it took to execute.
> I couldn't find a way in either sql *plus or sql worksheet?
Received on Tue Aug 24 1999 - 13:32:45 CDT

Original text of this message

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