+3 votes
in Databases by (56.5k points)
I want to check the execution time of queries so that I can use the best query to fetch the data from my database. How to see the execution time of SQL query in PostgreSQL?

1 Answer

+2 votes
by (348k points)
selected by
 
Best answer

After logging into PostgreSQL terminal, just run the following command on PostgreSQL terminal to turn on the timing.

mydb=> \timing
Timing is on.
If you want to turn off the timing, run the same command again.
mydb=> \timing
Timing is off.

Related questions


...