Search code examples
sqlverticavsql

How do I display the query time when a query completes in Vertica?


When using vsql, I would like to see how long a query took to run once it completes. For example when i run:

select count(distinct key) from schema.table;

I would like to see an output like:

5678
(1 row)
total query time: 55 seconds.

If this is not possible, is there another way to measure query time?


Solution

  • In vsql type:

    \timing 
    

    and then hit Enter. You'll like what you'll see :-)

    Repeating that will turn it off.