Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> an easier way to time a sql statement?
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