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: Timing a query in sqlplus

Re: Timing a query in sqlplus

From: MTNorman <mtnorman_at_duke-energy.com>
Date: 2 Feb 2007 09:00:20 -0800
Message-ID: <1170435620.914743.116310@a34g2000cwb.googlegroups.com>


On Feb 2, 9:41 am, "EscVector" <J..._at_webthere.com> wrote:
> On Feb 2, 7:41 am, "astalavista" <nob..._at_nowhere.com> wrote:
>
> > Hi,
>
> > In sqlplus, how to time a query ?
> > I set timing on
> > but the result seems to skewed by the display of the output lines (lot of
> > rows), no ?
> > How to get the correct timing for a query ?
>
> > Thanks in advance
>
> You could run it from a script with no output to screen or run create
> a refcursor and time the block execution.

Another way to get relative times between a set of queries is to encapsulte the original query and take a count... select count(1) from (<the original query>);

Because the same amount of data is returned (the count of the number of rows), timing difference is closely related to the query execution time. Please understand that this is only a "ball park" timing method for SQL tuning. Received on Fri Feb 02 2007 - 11:00:20 CST

Original text of this message

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