why my \timing doesn't work?
jiahe1224
Vertica Customer ✭
https://drive.google.com/file/d/1HVxD1g-hRSz1SlsmJpvGt_ZjQHvRylbL/view?usp=sharing
How can I test the duration of the query?
0
Best Answer
-
Bryan_H Vertica Employee Administrator
Timing appears at the bottom of the result set. You can direct the output to /dev/null with "\o /dev/null", then timing will be the only response:
d2=> \timing
Timing is on.
d2=> \o /dev/null
d2=> select * from airlines;
Time: First fetch (1000 rows): 28.702 ms. All rows formatted: 69.002 ms0
Answers
Thank you very much, I saw on the vertica academy that the duration can be displayed directly, it may be that the video has clips.
Try the following to troubleshoot the issue..
Repeated "\timing" might turn it on or off, so it is advised to use the explicit option "\timing on"
For example:
cat outputfile.txt
SELECT SET_DATA_COLLECTOR_POLICY('RequestsIssued', 2000, 256000, '3 days');
SELECT SET_DATA_COLLECTOR_POLICY('ExecutionSummaries', 2000, 50000, '3 days');
SELECT SLEEP(1); -- Place your query here instead of this line
SELECT REQUEST_DURATION_MS, transaction_id, statement_id, LEFT(REQUEST,110) AS Statement
FROM QUERY_REQUESTS
WHERE transaction_id=current_trans_id()
AND (statement_id=current_statement()-1);
Thank you very much for your answer, but it seems that there are some Linux redirection and other operations, I don’t quite understand, temporarily use Bryan_H’s solution to solve the problem.