Re: Delete query takes exorbitant amount of time - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: Delete query takes exorbitant amount of time
Date
Msg-id 20050326151658.D82144@megazone.bigpanda.com
Whole thread Raw
In response to Re: Delete query takes exorbitant amount of time  (Karim Nassar <karim.nassar@acm.org>)
Responses Re: Delete query takes exorbitant amount of time
List pgsql-performance
On Sat, 26 Mar 2005, Karim Nassar wrote:

> On Sat, 2005-03-26 at 07:55 -0800, Stephan Szabo wrote:
> > That seems like it should be okay, hmm, what does something like:
> >
> > PREPARE test(int) AS SELECT 1 from measurement where
> > id_int_sensor_meas_type = $1 FOR UPDATE;
> > EXPLAIN ANALYZE EXECUTE TEST(1);
> >
> > give you as the plan?
>
>                                                       QUERY PLAN
>
-----------------------------------------------------------------------------------------------------------------------
>  Seq Scan on measurement  (cost=0.00..164559.16 rows=509478 width=6)
>                           (actual time=11608.402..11608.402 rows=0 loops=1)
>                           Filter: (id_int_sensor_meas_type = $1)
>  Total runtime: 11608.441 ms
> (3 rows)

Hmm, has measurement been analyzed recently?  You might want to see if
raising the statistics target on measurement.id_int_sensor_meas_type and
reanalyzing changes the estimated rows down from 500k.


pgsql-performance by date:

Previous
From: Steve Poe
Date:
Subject: Re: How to improve db performance with $7K?
Next
From: Karim Nassar
Date:
Subject: Re: Delete query takes exorbitant amount of time