Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 861289FC19F for ; Fri, 13 Jul 2007 15:13:06 -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 84437-01-4 for ; Fri, 13 Jul 2007 15:12:47 -0300 (ADT) X-Greylist: delayed 00:33:33.896995 by SQLgrey-1.7.5 Received: from mail.jobflash.com (mail.jobflash.com [67.108.12.41]) by postgresql.org (Postfix) with ESMTP id C64D49FC153 for ; Fri, 13 Jul 2007 15:12:59 -0300 (ADT) Received: from [192.168.1.76] (adsl-76-204-77-35.dsl.pltn13.sbcglobal.net [76.204.77.35]) by mail.jobflash.com (Postfix) with ESMTP id B5F194210A; Fri, 13 Jul 2007 10:39:19 -0700 (PDT) Message-ID: <4697B8C7.7030304@jobflash.com> Date: Fri, 13 Jul 2007 10:39:19 -0700 From: Tom Arthurs User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: smiley2211 Cc: pgsql-performance@postgresql.org Subject: Re: Database Statistics??? References: <11583450.post@talk.nabble.com> In-Reply-To: <11583450.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/160 X-Sequence-Number: 25844 smiley2211 wrote: > 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. > You can update statistics with the analyze or vacuum analyze command, but I'd bet what you are seeing here is the effect of recreating the indices that replaying a backup does.