[MonetDB-users] how to measure a query execution time

Niels Nes Niels.Nes at cwi.nl
Mon Oct 8 19:34:54 CEST 2007


On Mon, Oct 08, 2007 at 08:02:55AM -0700, xxiao wrote:
> 
> Hi, 
> 
> I need to measure the sql query execution time. So I used "-t" option with
> mclient command. 
> 
> For example, I use "mclient -lsql -umonetdb -Pmonetdb -t < 15.sql" to
> execute query 15 in TPC-H benchmark. I have the following outputs:
> 
> Timer     935.765 msec 
This is the create view statement cost.
> Timer     717.294 msec 
> Timer       0.163 msec 
these too are strangly expensive as its only empty lines which are send.
> % sys.supplier, sys.supplier,   sys.supplier,   sys.supplier,   sys.revenue0
> # table_name
> % s_suppkey,    s_name, s_address,      s_phone,        total_revenue # name
> % int,  varchar,        varchar,        varchar,        decimal # type
> % 4,    18,     17,     15,     21 # length
> [ 8449, "Supplier#000008449",   "Wp34zim9qYFbVctdW",    "20-469-856-8873",    
> 1772627.2087     ]
> Timer    3559.856 msec 
The real select statement
> Timer       0.079 msec 
again an empty line
> Timer      63.676 msec 
The drop view statement
> Timer       0.890 msec 
empty line
> % .stats,       .stats # table_name
> % rewrite,      count # name
> % clob, int # type
> % 7,    1 # length
> [ "joinidx",    0       ]
> Timer       1.043 msec 
The select stats (this is just debugging ie not part of the tpch queries).

So as suggested by martin copy the query files and remove this stats part
(and any empty lines)

If you use mclient -lsql -t file.sql instead of < file.sql, then it measure
the time taken by the full file not per statement.

Niels
> 
> 
> There are multiple lines started with "Timer" and ended by a time
> measurement in milli-sec. So is the execution time of query 15 in TPC-H
> equal to the sum of all these time measurements. 
> 
> In this case,
> 935.765+717.294+0.163+3559.856+0.079+63.676+0.890+1.043=5278.766 msec.
> 
> I appreciate your response.
> 
> Xiang
> -- 
> View this message in context: http://www.nabble.com/how-to-measure-a-query-execution-time-tf4588760.html#a13098410
> Sent from the monetdb-users mailing list archive at Nabble.com.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> MonetDB-users mailing list
> MonetDB-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-users

-- 

Niels Nes, Centre for Mathematics and Computer Science (CWI)
Kruislaan 413, 1098 SJ Amsterdam, The Netherlands
room C0.02,  phone ++31 20 592-4098, fax ++31 20 592-4312
url: http://www.cwi.nl/~niels   e-mail: Niels.Nes at cwi.nl




More information about the users-list mailing list