snippetsqlCritical
How can I time SQL-queries using psql?
Viewed 0 times
cansqltimepsqlusinghowqueries
Problem
I would like to benchmark some SQL-queries agains my PostgreSQL database. Is there any way I can time SQL-queries using
psql?Solution
Timing can be turned on with
If you are on 8.4 or above, you can add an optional on/off argument to
\timing at the psql prompt (as Caleb already said).If you are on 8.4 or above, you can add an optional on/off argument to
\timing, which can be helpful if you want to be able to set timing on in .psqlrc - you can then set \timing on explicitly in a script where plain \timing would otherwise toggle it offContext
StackExchange Database Administrators Q#3148, answer score: 80
Revisions (0)
No revisions yet.