Query execution time and result


#1

I use the iquery client to do some queries and i want to see the query execution time. if i set no fetch, query executed quickly,but i can’t see the query execution time.
but if i set fetch and set timer, although the exection time shown is also short, but it takes a lot of time to see the query result. why?

i only want to see the query execution time ,not the query result. how can i do ? (i use AQL)

tthanks for you help!


#2

Here are two bash shell functions that I used to achieve what you’re looking for:

[code]#!/bin/sh

File: script.sh

About:

The goal of this script is to illustrate how we would use SciDB to build a

scalable, timeseries analysis platform to support financial analytics. The

questions that form the narrative underlying this script were provided

to us by a financial analytics firm.

I’ve salted questions through the script.

#------------------------------------------------------------------------------

Useful shell script functions.

exec_afl_query () {
echo “Query: ${1}”
/usr/bin/time -f “Elapsed Time: %E” iquery -o dcsv ${2} -aq “${1}”
};

exec_aql_query () {
echo “Query: ${1}”
/usr/bin/time -f “Elapsed Time: %E” iquery -o dcsv ${2} -q “${1}”
};

#------------------------------------------------------------------------------

[/code]

And here’s how I use it. . .

CMD_POPULATE_SIMPLE_STRINGS="
store ( 
  build ( String_Array_1, 
          'The Same String, All 9,999,999 Times, one after the other'
        ),
  String_Array_1
)
"
exec_afl_query "${CMD_POPULATE_SIMPLE_STRINGS};" -n

You can use the exec_aql_query variant if you want.