Re: slow query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: slow query
Date: 2007-04-05 05:27:25
Message-ID: 19157.1175750845@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> writes:
> am Wed, dem 04.04.2007, um 23:17:54 -0400 mailte Sumeet folgendes:
>> sm=> explain analyze select * from ma limit 10;
>> QUERY
>> PLAN
>> -------------------------------------------------------------------------------------------------------------------------------------
>> Limit (cost=0.00..0.45 rows=10 width=76) (actual time=21985.292..22204.340
>> rows=10 loops=1)
>> -> Seq Scan on ma (cost=0.00..2181956.92 rows=48235392 width=76) (actual
>> time=21985.285..22204.308 rows=10 loops=1)
>> Total runtime: 22204.476 ms
>> (3 rows)

> which version?

I'm betting the problem is poor vacuuming practice leading to lots of
dead space. There's no way it takes 22 sec to read 10 rows if the
table is reasonably dense.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2007-04-05 05:36:38 Re: slow query
Previous Message Tom Lane 2007-04-05 05:23:50 Re: Very slow DELETE on 4000 rows of 55000 row table