Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 96FD39FA47A for ; Tue, 12 Jun 2007 13:52:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 60914-05 for ; Tue, 12 Jun 2007 13:52:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cat.bucknet.co.za (cat.bucknet.co.za [196.211.0.10]) by postgresql.org (Postfix) with ESMTP id 0A6309FB3CF for ; Tue, 12 Jun 2007 13:51:59 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by cat.bucknet.co.za (Postfix) with ESMTP id 96F9323AECC; Tue, 12 Jun 2007 18:51:40 +0200 (SAST) X-Virus-Scanned: by cat at bucknet.co.za Received: from cat.bucknet.co.za ([127.0.0.1]) by localhost (cat.bucknet.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1omHXsxYE5zf; Tue, 12 Jun 2007 18:51:34 +0200 (SAST) Received: from fusion.bucknet.co.za (ns3.bucknet.co.za [196.38.143.226]) by cat.bucknet.co.za (Postfix) with ESMTP id AFFC123AEE7; Tue, 12 Jun 2007 18:51:28 +0200 (SAST) Received: from localhost (unknown [127.0.0.1]) by fusion.bucknet.co.za (Postfix) with ESMTP id 5A665C1403B; Tue, 12 Jun 2007 18:51:44 +0200 (SAST) X-Virus-Scanned: by Fusion at bucknet.co.za Received: from fusion.bucknet.co.za ([127.0.0.1]) by localhost (fusion.bucknet.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oOBDJriDOxmK; Tue, 12 Jun 2007 18:51:43 +0200 (SAST) Received: from [10.0.0.6] (unknown [196.25.216.139]) by fusion.bucknet.co.za (Postfix) with ESMTP id 9922DC14036; Tue, 12 Jun 2007 18:51:43 +0200 (SAST) Message-ID: <466ED0E4.3040803@mecola.com> Date: Tue, 12 Jun 2007 18:59:16 +0200 From: Christo Du Preez User-Agent: Thunderbird 1.5.0.10 (X11/20060911) MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: test / live environment, major performance difference References: <466EA078.20601@mecola.com> <8385.1181664586@sss.pgh.pa.us> In-Reply-To: <8385.1181664586@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.816 tagged_above=0 required=5 tests=AWL=-0.641, BAYES_50=0.001, RCVD_IN_SORBS_WEB=1.456 X-Spam-Level: X-Archive-Number: 200706/219 X-Sequence-Number: 25252 Yes, I have just about tried every combination of vacuum on the database. Just to make 100% sure. Tom Lane wrote: > Christo Du Preez writes: > >> On my laptop the explain analyze looks like this: >> > > >> "Index Scan using fki_layertype_parentid on layertype (cost=0.00..8.27 >> rows=1 width=109)" >> " Index Cond: (parentid = 300)" >> > > OK ... > > >> and on the problem server: >> > > >> "Seq Scan on layertype (cost=0.00..20.39 rows=655 width=110)" >> " Filter: (parentid = 300)" >> > > The server thinks that every row of the table matches the WHERE clause. > That being the case, it's making the right choice to use a seqscan. > The question is why is the rows estimate so far off? Have you ANALYZEd > the table lately? > > regards, tom lane > > > -- Christo Du Preez Senior Software Engineer Mecola IT Mobile: +27 [0]83 326 8087 Skype: christodupreez Website: http://www.locateandtrade.co.za