Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 889399FBB92 for ; Thu, 5 Apr 2007 00:18:05 -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 30340-02 for ; Thu, 5 Apr 2007 00:17:56 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 35C989FBB96 for ; Thu, 5 Apr 2007 00:17:56 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so838824ugf for ; Wed, 04 Apr 2007 20:17:54 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=t7SZ6D+UDtSyz4ghyKfO6cpX4Jnm9ftRnkebm0q+pUP910NrgmTrNSRdgnoCht6nV63xIRBu+mTDLzzP6iw4DZF1dRGoOW5h4lmEnIxpNCrEWUF6VpgpLPVSGrgmwMhCM1pC8rYIaapo7kzOfTfE80z4UsFpbKdnOptomtlXfJI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=GYJzKHaENoQpZc96sN/miEfUm3GxuOIc8deP9FRrPoRkHBVPApUQAlxIhOfQbioWdxEeWENlxPaIJOxoe+glT4ccvdBOrkEucq9Imn3TluKmcr5bszCXdfgLsEOzxGuAAL8y5OYR9M3wfjoXaasFT2YPsEkM0o/udffoCNW2dXE= Received: by 10.67.115.17 with SMTP id s17mr1859235ugm.1175743074945; Wed, 04 Apr 2007 20:17:54 -0700 (PDT) Received: by 10.66.247.18 with HTTP; Wed, 4 Apr 2007 20:17:54 -0700 (PDT) Message-ID: <7539aebb0704042017l70d83d53u9c2e5105620a3fa7@mail.gmail.com> Date: Wed, 4 Apr 2007 23:17:54 -0400 From: Sumeet To: pgsql-sql Subject: slow query MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18575_15060487.1175743074901" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/60 X-Sequence-Number: 28060 ------=_Part_18575_15060487.1175743074901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all I ran a simple query like the one displayed below and it takes a lot of time to execute on this table. This table has 48 million records....and i worry about this table a lot coz i need to perform join on this table with some other table having around 13 million records....I've tried vacuuming this table many time but dint help me much...is there any other trick to speed up this table....once i tried deleting and restoring a table and it worked perfectly fine for a small table of size upto 5-6 million records 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.340rows=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) -- Thanks, Sumeet ------=_Part_18575_15060487.1175743074901 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all

I ran a simple query like the one displayed below and it takes a lot of time to execute on this table.
This table has 48 million records....and i worry about this table a lot coz i need to perform join on this
table with some other table having around 13 million records....I've tried vacuuming this table many time
but dint help me much...is there any other trick to speed up this table....once i tried deleting and restoring a table
and it worked perfectly fine for a small table of size upto 5-6 million records

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)


--
Thanks,
Sumeet ------=_Part_18575_15060487.1175743074901--