X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3F124D1C9C8 for ; Thu, 31 Jul 2003 19:33:54 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 76254-03 for ; Thu, 31 Jul 2003 16:32:49 -0300 (ADT) Received: from email06.aon.at (WARSL402PIP3.highway.telekom.at [195.3.96.75]) by svr1.postgresql.org (Postfix) with SMTP id B471BD1C9DD for ; Thu, 31 Jul 2003 16:33:50 -0300 (ADT) Received: (qmail 101802 invoked from network); 31 Jul 2003 19:13:08 -0000 Received: from m168p012.dipool.highway.telekom.at (HELO cantor) ([62.46.10.236]) (envelope-sender ) by qmail6rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 31 Jul 2003 19:13:08 -0000 From: Manfred Koizar To: "Jianshuo Niu" Cc: pgsql-performance@postgresql.org Subject: Re: Help on my database performance Date: Thu, 31 Jul 2003 21:13:07 +0200 Message-ID: <97qiivonvj5brg9q7ale1033fp53rupi54@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/501 X-Sequence-Number: 2794 On Thu, 31 Jul 2003 11:06:09 -0400, "Jianshuo Niu" wrote: >I ran the same explain analyze on two similar tables. However, the table >with less data took much more time than the one with more data. Could anyone >tell me what happened? >Seq Scan on tfd_catalog (cost=0.00..43769.82 rows=161282 width=10) (actual >time=3928.64..12905.76 rows=161282 loops=1) >Total runtime: 13240.21 msec > >Seq Scan on hm_catalog (cost=0.00..22181.18 rows=277518 width=9) (actual >time=21.32..6420.76 rows=277518 loops=1) >Total runtime: 6772.95 msec The first SELECT takes almost twice the time because tfd_catalog has almost twice as many pages than hm_catalog. This may be due to having wider tuples or more dead tuples in tfd_catalog. In the former case theres not much you can do. But the high startup cost of the first SELECT is a hint for lots of dead tuples. So VACUUM FULL ANALYSE might help. Servus Manfred