Path: news.f.de.plusline.net!news-fra1.dfn.de!kanaga.switch.ch!switch.ch!news.maxwell.syr.edu!postnews.google.com!a34g2000cwb.googlegroups.com!not-for-mail
From: "MTNorman" <mtnorman@duke-energy.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: Timing a query in sqlplus
Date: 2 Feb 2007 09:00:20 -0800
Organization: http://groups.google.com
Lines: 25
Message-ID: <1170435620.914743.116310@a34g2000cwb.googlegroups.com>
References: <45c3315a$0$16191$426a74cc@news.free.fr>
   <1170427316.638158.220310@a75g2000cwd.googlegroups.com>
NNTP-Posting-Host: 148.134.37.3
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1170435626 23967 127.0.0.1 (2 Feb 2007 17:00:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 2 Feb 2007 17:00:26 +0000 (UTC)
In-Reply-To: <1170427316.638158.220310@a75g2000cwd.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: a34g2000cwb.googlegroups.com; posting-host=148.134.37.3;
   posting-account=R9Xy5Q0AAACBfoRETPNOB28HQN4N2LNQ
Xref: news.f.de.plusline.net comp.databases.oracle.server:193510

On Feb 2, 9:41 am, "EscVector" <J...@webthere.com> wrote:
> On Feb 2, 7:41 am, "astalavista" <nob...@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.

