Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 411459FB86D for ; Thu, 5 Apr 2007 02:27:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 57931-03 for ; Thu, 5 Apr 2007 02:27:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0C2CA9FB4D5 for ; Thu, 5 Apr 2007 02:27:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l355RPpw019158; Thu, 5 Apr 2007 01:27:25 -0400 (EDT) To: "A. Kretschmer" cc: pgsql-sql@postgresql.org Subject: Re: slow query In-reply-to: <20070405051127.GA24814@a-kretschmer.de> References: <7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com> <20070405051127.GA24814@a-kretschmer.de> Comments: In-reply-to "A. Kretschmer" message dated "Thu, 05 Apr 2007 07:11:27 +0200" Date: Thu, 05 Apr 2007 01:27:25 -0400 Message-ID: <19157.1175750845@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/65 X-Sequence-Number: 28065 "A. Kretschmer" 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