There are some fundamental “philosophical” questions about what “query run-time” actually means.
One thing you could say is:
$ time iquery -anq "QUERY"
This will give you a runtime (as per the unix time utility) without retrieving results. But unfortunately some scidb queries are computed lazily; the system will not do any work if you don’t ask for the results. So this won’t work.
$ time iquery -aq "QUERY"
$ time iquery -aq "QUERY" > file.out
Now you are measuring multiple things:
- time to run the query
- time to return the result to the coordinator
- time to convert the result to text form and dump it to file / stdout
Unfortunately if your result set is large, step 3 will take up most of the time - and you will not be measuring the right thing. However, if the result set is small, then this method works reasonably well. Note that you can have large complex queries that return one or ten values.
$ iquery -r /dev/null -avq "QUERY"
This way will ship all the data to the coordinator and iterate over the entire result. But it will not convert the result to text form. It will also make iquery output some cute timings and stats.
One other thing you can try is:
$ time iquery -anq "store(QUERY, TEMP)"
This measures the amount of time to run the query and store it as a temporary array. Of course, storing the data can be expensive, so you can only use this method relative to other store() queries. I like this method because it works for all result set sizes and has a nice property of data never leaving the system.
So if your result set size is small, I recommend Method 1. If your result set is large, I recommend either Method 2 or Method 3.
Hope it helps.