Skip to main content
Question

why my \timing doesn't work?

  • November 17, 2022
  • 4 replies
  • 9 views

jiahe1224
Forum|alt.badge.img+1

4 replies

Bryan_H
Forum|alt.badge.img+2
  • Participating Frequently
  • November 17, 2022

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 ms


jiahe1224
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • November 17, 2022

@Bryan_H said:

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.


mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • November 17, 2022

Try the following to troubleshoot the issue..

  1. Start vsql with the -X option. With this option vsql do not read startup file (~/.vsqlrc)
    Repeated "\timing" might turn it on or off, so it is advised to use the explicit option "\timing on"
    For example:
  printf '\\timing on \n select sleep(1);' | vsql -X
  1. Try to turn on vsql -Xi -c "select sleep(1);"
  2. vsql -Xeic "select sleep(1);" > outputfile.txt 2>&1
    cat outputfile.txt
  3. Try the following in your QA environment..
    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);

jiahe1224
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • November 19, 2022

@mosheg said:

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.