Re: Delete query takes exorbitant amount of time

Поиск
Список
Период
Сортировка
От Karim A Nassar
Тема Re: Delete query takes exorbitant amount of time
Дата
Msg-id Pine.SOL.4.21.0503280934160.831-100000@coruscant.cet.nau.edu
обсуждение исходный текст
Ответ на Re: Delete query takes exorbitant amount of time  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-performance
On Mon, 28 Mar 2005, Stephan Szabo wrote:
> > On Mon, 28 Mar 2005, Simon Riggs wrote:
> > > run the EXPLAIN after doing
> > >     SET enable_seqscan = off

...

> I think you have to prepare with enable_seqscan=off, because it
> effects how the query is planned and prepared.

orfs=# SET enable_seqscan = off;
SET
orfs=# PREPARE test2(int) AS SELECT 1 from measurement where
orfs-# id_int_sensor_meas_type = $1 FOR UPDATE;
PREPARE
orfs=#  EXPLAIN ANALYZE EXECUTE TEST2(1); -- non-existent

QUERY PLAN
-------------------------------------------------------------------------
 Index Scan using measurement__id_int_sensor_meas_type_idx on measurement
    (cost=0.00..883881.49 rows=509478 width=6)
    (actual time=29.207..29.207 rows=0 loops=1)
   Index Cond: (id_int_sensor_meas_type = $1)
 Total runtime: 29.277 ms
(3 rows)

orfs=#  EXPLAIN ANALYZE EXECUTE TEST2(197); -- existing value

QUERY PLAN
-------------------------------------------------------------------------
 Index Scan using measurement__id_int_sensor_meas_type_idx on measurement
    (cost=0.00..883881.49 rows=509478 width=6)
    (actual time=12.903..37478.167 rows=509478 loops=1)
   Index Cond: (id_int_sensor_meas_type = $1)
 Total runtime: 38113.338 ms
(3 rows)

--
Karim Nassar
Department of Computer Science
Box 15600, College of Engineering and Natural Sciences
Northern Arizona University,  Flagstaff, Arizona 86011
Office: (928) 523-5868 -=- Mobile: (928) 699-9221





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

Предыдущее
От: Karim A Nassar
Дата:
Сообщение: Re: Delete query takes exorbitant amount of time
Следующее
От: "ALÝ ÇELÝK"
Дата:
Сообщение: coalesce alternative