Re: Slow Query - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow Query
Date
Msg-id 25184.1188702010@sss.pgh.pa.us
Whole thread Raw
In response to Re: Slow Query  (Shawn <postgres@xmtservices.net>)
Responses Re: Slow Query
List pgsql-performance
Shawn <postgres@xmtservices.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

pgsql-performance by date:

Previous
From: Shawn
Date:
Subject: Re: Slow Query
Next
From: "Kevin Grittner"
Date:
Subject: Re: Slow Query