From: Artur Zając <azajac@ang.com.pl>
To: 'Robert Haas' <robertmhaas@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Difference between explain analyze and real execution time
Date: Mon, 15 Nov 2010 21:43:48 +0100
Message-ID: <009d01cb8505$ce738900$6b5a9b00$@ang.com.pl> (raw)
In-Reply-To: <AANLkTim=wpohtfWkNx-=22jcagXndrfTwjvogNt9=f0D@mail.gmail.com>
References: <000001cb849e$1dce2720$596a7560$@ang.com.pl>
<AANLkTim=wpohtfWkNx-=22jcagXndrfTwjvogNt9=f0D@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: azajac@ang.com.pl, robertmhaas@gmail.com
Subject: Re: Difference between explain analyze and real execution time
In-Reply-To: <009d01cb8505$ce738900$6b5a9b00$@ang.com.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox