Re: utility to time queries
Posted in 2000
Topics: Server Administration
Paul Watson wrote:
>
> >-----Original Message-----
> >From: Carlson@WHSmith [mailto:carlson1@bellsouth.net]
> >Greg Starnes wrote:
> >>
> >> Does Informix have a SET TIMING ON function? SET TIMIMG ON is the Oracle
> >> function.
> >> I'm trying to tune a bunch of queries, and would like the db to time the
> how
> >> long the query takes .
> >>
> >> thanks,
> >> gs
> >
> >Are you in a UNIX environment? I always use 'timex', as in
> > timex dbaccess <dbase_name> <SQL file>
> >
>
> Depending on the OS and command line you are using you should use time (the
> shell
> builtin) 'cos it can more accurately track across process boundaries
I think you'll find that on most modern Unices, timex is a link to time.
;-)
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |What year 2000 bug? year 2000 bug? |/// / ////|
| |year 2000 bug? year 2000 bug? year |// / /////|
| |2000 bug? year 2000 bug? year 1900 |/ ////////|
+----------------------+-----------------------------------+-----------+
"Mark D. Stock" wrote:
> Paul Watson wrote:
> > >From: Carlson@WHSmith [mailto:carlson1@bellsouth.net]
> > >Greg Starnes wrote:
> > >> Does Informix have a SET TIMING ON function? SET TIMIMG ON is the Oracle
> > >> function.
> > >> I'm trying to tune a bunch of queries, and would like the db to time the
> how
> > >> long the query takes .
> > >
> > >Are you in a UNIX environment? I always use 'timex', as in
> > > timex dbaccess <dbase_name> <SQL file>
> >
> > Depending on the OS and command line you are using you should use time (the
> > shell builtin) 'cos it can more accurately track across process boundaries
>
> I think you'll find that on most modern Unices, timex is a link to time.
> ;-)
The trouble with time or timex is that it measures the time it
takes to execute the whole program, database connection, output
formatting and all, whereas you may want to time sub-sections,
or each separate query in a set of 6 that build the overall answer
with a bunch of temp tables, or whatever. For that, you need
support in the tool -- SQLCMD provides that. Check out the
benchmark mode (-B).
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v1.00.PC1 -- see http://www.perl.com/CPAN
#include <disclaimer.h>