Large time difference between explain analyze and normal run

Поиск
Список
Период
Сортировка
От Chris Kratz
Тема Large time difference between explain analyze and normal run
Дата
Msg-id 200502101334.40341.chris.kratz@vistashare.com
обсуждение исходный текст
Ответы Re: Large time difference between explain analyze and normal run  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Does anyone have any idea why there be over a 4s difference between running
the statement directly and using explain analyze?  Multiple runs give the
same result and I've tested on several servers.

db=# \timing
Timing is on.
db=# select count(*) from answer;
 count
--------
 530576
(1 row)

Time: 358.805 ms
db=# explain analyze select count(*) from answer;
                                                      QUERY PLAN
----------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=9848.12..9848.12 rows=1 width=0) (actual
time=4841.231..4841.235 rows=1 loops=1)
   ->  Seq Scan on answer  (cost=0.00..8561.29 rows=514729 width=0) (actual
time=0.011..2347.762 rows=530576 loops=1)
 Total runtime: 4841.412 ms
(3 rows)

Time: 4855.712 ms

---

Postgresql 7.4.5 running on Linux 2.6.8.1

В списке pgsql-performance по дате отправления:

Предыдущее
От: Jeff
Дата:
Сообщение: Re: Benchmark
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Large time difference between explain analyze and normal run