Re: Difference between explain analyze and real execution time - Mailing list pgsql-performance

From Artur Zając
Subject Re: Difference between explain analyze and real execution time
Date
Msg-id 009d01cb8505$ce738900$6b5a9b00$@ang.com.pl
Whole thread Raw
In response to Re: Difference between explain analyze and real execution time  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Difference between explain analyze and real execution time  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance

2010/11/15 Artur Zając <azajac@ang.com.pl>:
> Why there is so big difference between explain analyze (0.710 ms) and
> real execution time (3309 ms)? Any suggestions?

> Could it be that it takes a long time to plan for some reason?  How fast
is a plain EXPLAIN?

Yes! That is it :) Planning is painful. I'm so stupid. I didn't check VACUUM
without ANALYZE :)

time psql  -c 'explain SELECT te.idt FROM t_positions AS te    WHERE te.idtr
IN (347186)'

real    0m1.087s
user    0m0.004s
sys     0m0.001s

I've changed default_statistics_target to 10000 and I think that is a
reason. When I changed it to 1000 everything seems to be ok:

time psql  -c 'explain analyze SELECT te.idt FROM t_positions AS te    WHERE
te.idtr IN (347186)'

real    0m0.062s
user    0m0.003s
sys     0m0.004s

Thanks.

-------------------------------------------
Artur Zajac



pgsql-performance by date:

Previous
From: Robert Haas
Date:
Subject: Re: Difference between explain analyze and real execution time
Next
From: Tom Lane
Date:
Subject: Re: Difference between explain analyze and real execution time