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

Ilya Kaplun picture Ilya Kaplun · Jul 20, 2011 · Viewed 8.9k times · Source

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?

Answer

Igor picture Igor · Jul 21, 2011

In vsql type:

\timing 

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

Repeating that will turn it off.