Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id AFFA29FB4F0 for ; Tue, 12 Jun 2007 10:45:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 44422-09 for ; Tue, 12 Jun 2007 10:45:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from relay.mail.twtelecom.net (relay.mail.twtelecom.net [64.129.67.72]) by postgresql.org (Postfix) with ESMTP id 8877C9FB3FF for ; Tue, 12 Jun 2007 10:45:27 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by relay.mail.twtelecom.net (Postfix) with ESMTP id 11D017BC2D2 for ; Tue, 12 Jun 2007 07:45:26 -0600 (MDT) X-Virus-Scanned: amavisd-new at twtelecom.net Received: from relay.mail.twtelecom.net ([127.0.0.1]) by localhost (relay-2.dnvr.twtelecom.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c204ZUM7cX2v for ; Tue, 12 Jun 2007 07:45:21 -0600 (MDT) Received: from mailblocker.ateb.com (ateb.com [66.193.74.200]) by relay.mail.twtelecom.net (Postfix) with ESMTP id 983D57BC2E5 for ; Tue, 12 Jun 2007 07:45:21 -0600 (MDT) X-IronPort-AV: E=Sophos;i="4.16,412,1175486400"; d="scan'208";a="215243" Received: from unknown (HELO sr002-2k3exc.ateb.com) ([192.168.100.228]) by mailblocker.ateb.com with SMTP; 12 Jun 2007 09:45:21 -0400 Received: from 192.168.100.14 ([192.168.100.14]) by sr002-2k3exc.ateb.com ([192.168.100.228]) with Microsoft Exchange Server HTTP-DAV ; Tue, 12 Jun 2007 13:45:21 +0000 Received: from jhereg by sr002-2k3exc.ateb.com; 12 Jun 2007 09:45:20 -0400 Subject: Re: test / live environment, major performance difference From: Reid Thompson Reply-To: Reid.Thompson@ateb.com To: Christo Du Preez Cc: pgsql-performance@postgresql.org In-Reply-To: <466EA078.20601@mecola.com> References: <466EA078.20601@mecola.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 12 Jun 2007 09:45:20 -0400 Message-Id: <1181655920.19256.3.camel@jhereg> Mime-Version: 1.0 X-Mailer: Evolution 2.11.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/202 X-Sequence-Number: 25235 try it with a table with 650K rows... On Tue, 2007-06-12 at 15:32 +0200, Christo Du Preez wrote: > Good day, > > I have noticed that my server never uses indexing. No matter what I do. > > As an example I took a table with about 650 rows, having a parentid > field with an index on parentid. > > EXPLAIN ANALYZE > SELECT * > FROM layertype > where parentid = 300; > > 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)" > > and on the problem server: > > "Seq Scan on layertype (cost=0.00..20.39 rows=655 width=110)" > " Filter: (parentid = 300)" > > ......... > > I have dropped the index, recreated it, vacuumed the table, just about > everything I could think of, And there is just no way I can get the > query planner to use the index. > > PostgreSQL 8.2.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 > 20061115 (prerelease) (SUSE Linux) > POSTGIS="1.2.1" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct > 2006" USE_STATS > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq