PostgreSQL & PHP Tutorials - PostgreSQL Query Timing

PostgreSQL »  PostgreSQL Query Timing
PostgreSQL »  Hints and Tips »  PostgreSQL Query Timing

Posted By Chris Smith Posted on 15 Feb 2006, 01:06 AM
How do you know how long a query took?

PostgreSQL lets you time the queries and print the output in your psql session.

Create a $HOME/.psqlrc file with:

\timing

in it and next time you log in to a psql session, PostgreSQL will show you how long the query took!

Doing it this way means every time you log in, it will happen.

To turn it off, at the psql prompt, type it again:

testing=> \timing
Timing is off.

or remove it from your $HOME/.psqlrc file.


Avg Rating: 4
Vote Count: 8


              


Want to post a comment? Fill in the details below.

Your Name  : 
Your Email  : 
Your Website  : 
Spam Check! Please answer this question  : 1 + 1 =
Comment