why my \timing doesn't work?

Best Answer

  • Options
    Bryan_HBryan_H Vertica Employee Administrator
    Answer ✓

    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


  • Options
    jiahe1224jiahe1224 Vertica Customer

    @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.

  • Options
    moshegmosheg Vertica Employee Administrator
    edited November 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
      WHERE transaction_id=current_trans_id()
      AND (statement_id=current_statement()-1);
  • Options
    jiahe1224jiahe1224 Vertica Customer

    @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.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file