Skip site navigation (1) Skip section navigation (2)

Re: Delete query takes exorbitant amount of time

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Karim A Nassar <Karim(dot)Nassar(at)NAU(dot)EDU>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Delete query takes exorbitant amount of time
Date: 2005-03-28 16:27:36
Message-ID: 20050328082645.X95787@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, 28 Mar 2005, Karim A Nassar wrote:

> On Mon, 28 Mar 2005, Simon Riggs wrote:
> > run the EXPLAIN after doing
> > 	SET enable_seqscan = off
>
> The results I previously supplied were searching for a non-existent
> value, so I have provided output for both cases.
>
> ***
> *** Searching for non-existent value
> ***
>
> 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);
>  QUERY PLAN
> --------------------------------------------------------------------------
>  Seq Scan on measurement
>     (cost=0.00..164559.16 rows=509478 width=6)
>     (actual time=6421.849..6421.849 rows=0 loops=1)
>    Filter: (id_int_sensor_meas_type = $1)
>  Total runtime: 6421.917 ms
> (3 rows)
>
> orfs=#  SET enable_seqscan = off;

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


Responses

pgsql-performance by date

Next:From: Karim A NassarDate: 2005-03-28 16:37:01
Subject: Re: Delete query takes exorbitant amount of time
Previous:From: Thomas F.O'ConnellDate: 2005-03-28 15:44:49
Subject: Re: Configuration/Tuning of server/DB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group