Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3DFC79FB7DB for ; Mon, 11 Jun 2007 13:25:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58862-06 for ; Mon, 11 Jun 2007 13:25:33 -0300 (ADT) X-Greylist: delayed 00:26:33.278945 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 03F4B9FB71B for ; Mon, 11 Jun 2007 13:25:32 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.planetcobalt.net (mail.planetcobalt.net [217.10.9.49]) by svr4.postgresql.org (Postfix) with ESMTP id 7C1E15AF88B for ; Mon, 11 Jun 2007 15:58:58 +0000 (GMT) Received: by mail.planetcobalt.net (Postfix, from userid 1000) id C9C8E3C00085; Mon, 11 Jun 2007 17:58:49 +0200 (CEST) Date: Mon, 11 Jun 2007 17:58:49 +0200 From: Ansgar -59cobalt- Wiechers To: pgsql-performance@postgresql.org Subject: Re: test / live environment, major performance difference Message-ID: <20070611155849.GA8426@mail.planetcobalt.net> References: <466D65CA.6000503@mecola.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466D65CA.6000503@mecola.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL=0.050, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/192 X-Sequence-Number: 25225 On 2007-06-11 Christo Du Preez wrote: > I really hope someone can shed some light on my problem. I'm not sure > if this is a posgres or potgis issue. > > Anyway, we have 2 development laptops and one live server, somehow I > managed to get the same query to perform very well om my laptop, but > on both the server and the other laptop it's really performing bad. You write that you have 3 systems, but provided only two EXPLAIN ANALYZE results. I will assume that the latter is from your laptop while the former is from one of the badly performing systems. > All three environments are running the same versions of everything, > the two laptops are identical and the server is a monster compared to > the laptops. Please provide information what exactly those "same versions of everything" are. What's the PostgreSQL configuration on each system? Do all three systems have the same configuration? Information on the hardware wouldn't hurt either. [...] > Sort (cost=181399.77..182144.30 rows=297812 width=370) (actual > time=1384.976..1385.072 rows=180 loops=1) [...] > Sort (cost=37993.10..37994.11 rows=403 width=266) (actual > time=32.053..32.451 rows=180 loops=1) The row estimate of the former plan is way off (297812 estimated <-> 180 actual). Did you analyze the table recently? Maybe you need to increase the statistics target. Regards Ansgar Wiechers -- "The Mac OS X kernel should never panic because, when it does, it seriously inconveniences the user." --http://developer.apple.com/technotes/tn2004/tn2118.html