Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4BA809FB7D8 for ; Fri, 13 Jul 2007 15:33:27 -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 52066-08 for ; Fri, 13 Jul 2007 15:33:19 -0300 (ADT) X-Greylist: delayed 00:13:27.994103 by SQLgrey-1.7.5 Received: from relay.icomedias.com (relay.icomedias.com [62.99.232.66]) by postgresql.org (Postfix) with ESMTP id 9D6449FB3A5 for ; Fri, 13 Jul 2007 15:33:21 -0300 (ADT) Received: from loki.local ([10.192.17.128]) by relay.icomedias.com (8.13.7/8.13.7) with ESMTP id l6DIJkWR023672; Fri, 13 Jul 2007 20:19:46 +0200 From: Mario Weilguni To: pgsql-performance@postgresql.org Subject: Re: Database Statistics??? Date: Fri, 13 Jul 2007 20:19:51 +0200 User-Agent: KMail/1.9.7 Cc: smiley2211 References: <11583450.post@talk.nabble.com> In-Reply-To: <11583450.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200707132019.51450.mweilguni@sime.com> X-Scanned-By: MIMEDefang 2.57 on 10.192.64.104 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/163 X-Sequence-Number: 25847 Am Freitag 13 Juli 2007 schrieb smiley2211: > Hello all, > > I am a bit confused...I have a database which was performing very POORLY > selecting from a view (posted earlier) on one server but extremely fast on > another server... > > I just backed up the database from the FAST server and loaded to the SLOW > server and it ran just as fast as it originally did...my questions are: > > Are STATISTICS some how saved with the database?? if so, how do I UPDATE > view or update them? > > Should I backup the data \ drop the database and reload it to make it get > new stats?? (vacuum analyze does nothing for this poor performing database) > > Thanks-a-bunch. Try this on both machines: select relname, relpages, reltuples from pg_class where relkind='i' order by relpages desc limit 20; Compare the results, are relpages much higher on the slow machine? If so, REINDEX DATABASE slow_database;