Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 545A09FBA20 for ; Tue, 12 Jun 2007 13:10:18 -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 72459-01 for ; Tue, 12 Jun 2007 13:10:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E8FC09FBA00 for ; Tue, 12 Jun 2007 13:10:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5CG9kHV008386; Tue, 12 Jun 2007 12:09:46 -0400 (EDT) To: Christo Du Preez cc: pgsql-performance@postgresql.org Subject: Re: test / live environment, major performance difference In-reply-to: <466EA078.20601@mecola.com> References: <466EA078.20601@mecola.com> Comments: In-reply-to Christo Du Preez message dated "Tue, 12 Jun 2007 15:32:40 +0200" Date: Tue, 12 Jun 2007 12:09:46 -0400 Message-ID: <8385.1181664586@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/216 X-Sequence-Number: 25249 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