Re: Slow Query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shawn <postgres(at)xmtservices(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow Query
Date: 2007-09-02 03:00:10
Message-ID: 25184.1188702010@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Shawn <postgres(at)xmtservices(dot)net> writes:
> The query just ran and here is the basic output:

> UPDATE 15445
> Time: 22121.141 ms

> and

> explain ANALYZE update shawns_data set alias = null;
> QUERY PLAN
> -----------------------------------------------------------------------------------------------------------------
> Seq Scan on shawns_data (cost=0.00..465.45 rows=15445 width=480) (actual time=0.034..67.743 rows=15445 loops=1)
> Total runtime: 1865.002 ms
> (2 rows)

Hmmm ... did you run the real query and the EXPLAIN in immediate
succession? If so, the only reason I can think of for the speed
difference is that all the rows were fetched already for the second
run. Which doesn't make a lot of sense given the hardware specs
you mentioned. Try watching "vmstat 1" and see if there's some
noticeable difference in the behavior.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2007-09-02 15:49:09 Re: Slow Query
Previous Message Shawn 2007-09-02 00:35:19 Re: Slow Query