Skip site navigation (1) Skip section navigation (2)

What does \timing measure?

From: Mathieu Dubois <mathieu(dot)dubois(at)limsi(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: What does \timing measure?
Date: 2011-04-07 19:52:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I want to compare the time needed to execute 2 queries (which give the 
same results).
Of course this depends on the server load, the network, etc.

The basic idea is to use "\timing on" under psql but what is the 
returned time? The time to execute the query on the server or the time 
to fetch the results?

In the first case the measurement would be more useful (no effect of the 
network and the client side).

I have also a methodological question.
The idea is to measure several times the same query (let's say 50 times) 
to get basic statistics.
If I repeat the same query 50 times will the server use some caching 
mechanism to accelerate the query? In my case, this is not wanted 
(because I want to measure the normal query time).

Thanks in advance,


pgsql-novice by date

Next:From: Josh KupershmidtDate: 2011-04-08 03:04:42
Subject: Re: What does \timing measure?
Previous:From: java4devDate: 2011-04-05 18:26:12
Subject: Re: how to call stored procedures with output parameters

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group