On Tuesday 20 October 2009 10:44:13 am Scott Marlowe's cat walking on the
keyboard wrote:
> Two things. 1: Actually running the query and receiving the results
> isn't the same as just running it and throwing them away (what explain
> analyze does) and 2: The query may be getting cached in psql if you're
> running it more than once, but it may not run often enough on that
> data set to get the same caching each time.
>
You are right, in fact executing:
psql -h localhost -U dataflex cogedb -c "SELECT * FROM GMMOVART WHERE DATA
>= '01/01/2006' AND DATA <= '31/12/2006' ORDER BY DATA, CONTATORE, RIGA" -o
/dev/null
produces a log like the following:
cogedb LOG: duration: 8841.152 ms statement: SELECT * FROM GMMOVART WHERE
DATA >= '01/01/2006' AND DATA <= '31/12/2006' ORDER BY DATA, CONTATORE, RIGA
so 8,8 seconds against 7 seconds, now it sounds compatible. But I was always
trusting the time of explain analyze, this make me doubt about it. So how is
such time (explain analyze) to mind?
Luca