X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6E0049FA0B9 for ; Mon, 17 Jul 2006 17:19:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 53907-10 for ; Mon, 17 Jul 2006 17:19:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.207]) by postgresql.org (Postfix) with ESMTP id 13FCA9F9F27 for ; Mon, 17 Jul 2006 17:19:17 -0300 (ADT) Received: by wx-out-0102.google.com with SMTP id t5so723626wxc for ; Mon, 17 Jul 2006 13:19:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Mfb1NlosqGwCcns2Y2uEiVR7IJNYCFAKZCi+2ziKtV7pcM8QELtlMLutrxl5k2JycBLcxA+Rqoh29IobiWmAHYSJi8JZ9X8VXxJiugZyZ1tQ669xlMiXlc6AqDTXO0FGQs6/ZvK3xZKudgD5aQQdmKNuhri9KUdX5GHGSHudHQ0= Received: by 10.70.14.18 with SMTP id 18mr3390174wxn; Mon, 17 Jul 2006 13:19:14 -0700 (PDT) Received: by 10.70.73.15 with HTTP; Mon, 17 Jul 2006 13:19:14 -0700 (PDT) Message-ID: <1d219a6f0607171319k731ae186wc85cdca45851a51@mail.gmail.com> Date: Mon, 17 Jul 2006 16:19:14 -0400 From: "Chris Hoover" To: "Gabriele Turchi" Subject: Re: Big differences in plans between 8.0 and 8.1 Cc: "Joe Conway" , "Michael Fuhr" , pgsql-performance@postgresql.org, "Marco Colombo" In-Reply-To: <1152994970.3541.31.camel@apollo5.casa.intranet> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_65397_23033031.1153167554040" References: <1152972852.3541.0.camel@apollo5.casa.intranet> <20060715190210.GA76277@winnie.fuhr.org> <1152993350.3541.22.camel@apollo5.casa.intranet> <44B94A51.9050108@joeconway.com> <1152994970.3541.31.camel@apollo5.casa.intranet> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/169 X-Sequence-Number: 20029 ------=_Part_65397_23033031.1153167554040 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Just turn on autovacuuming on your 8.1 database. You can tune the vacuum and autovacuum parameters to minimize the impact to your system. This is the optimal route to take since PG will maintain the tables for you as needed. HTH, Chris On 7/15/06, Gabriele Turchi wrote: > > Il giorno sab, 15/07/2006 alle 13.04 -0700, Joe Conway ha scritto: > > Gabriele Turchi wrote: > > > Running an ANALYZE really change the plan, now it is fast as before > > > (8.0). > > > > > > On the production system a VACUUM FULL ANALYZE is run every morning > > > after a clean-up, when the "registrazioni" table is empty. During the > > > day this table fills up (about 500 record any day), and apparently the > > > performances are free-falling very quickly. This behaviour has not > > > changed between the old and the new installation. > > > > > > Can you suggest an easy way to collect and keep up-to-date these > > > statistics in a very low-impact way? > > > > > > > Why not just periodically (once an hour?) run "ANALYZE registrazioni;" > > during the day. This will only update the statistics, and should be very > > low impact. > > > > This is my "solution" too... but: is enough? Or else: there is a better > way to do this? If the performance in the better case is 50 times faster > than the worse case, during an hour (50/100 record inserted in > "registrazioni") how much the performance can fall before the new > "ANALYZE" is run? Otherwise, running ANALYZE more frequently can badly > affect the overall performance? > > A so big difference in postgres performance, can be considered a bug or > a over-optimization in the plan making? Why (at least apparently) the > 8.0 version is not affected? > > > HTH, > > > > Joe > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 6: explain analyze is your friend > > Thank you all very much, > Gabriele > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > ------=_Part_65397_23033031.1153167554040 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Just turn on autovacuuming on your 8.1 database.  You can tune the vacuum and autovacuum parameters to minimize the impact to  your system.  This is the optimal route to take since PG will maintain the tables for you as needed.

HTH,

Chris

On 7/15/06, Gabriele Turchi <gabriele.turchi@l39a.com> wrote:
Il giorno sab, 15/07/2006 alle 13.04 -0700, Joe Conway ha scritto:
> Gabriele Turchi wrote:
> > Running an ANALYZE really change the plan, now it is fast as before
> > (8.0).
> >
> > On the production system a VACUUM FULL ANALYZE is run every morning
> > after a clean-up, when the "registrazioni" table is empty. During the
> > day this table fills up (about 500 record any day), and apparently the
> > performances are free-falling very quickly. This behaviour has not
> > changed between the old and the new installation.
> >
> > Can you suggest an easy way to collect and keep up-to-date these
> > statistics in a very low-impact way?
> >
>
> Why not just periodically (once an hour?) run "ANALYZE registrazioni;"
> during the day. This will only update the statistics, and should be very
> low impact.
>

This is my "solution" too... but: is enough? Or else: there is a better
way to do this? If the performance in the better case is 50 times faster
than the worse case, during an hour (50/100 record inserted in
"registrazioni") how much the performance can fall before the new
"ANALYZE" is run? Otherwise, running ANALYZE more frequently can badly
affect the overall performance?

A so big difference in postgres performance, can be considered a bug or
a over-optimization in the plan making? Why (at least apparently) the
8.0 version is not affected?

> HTH,
>
> Joe
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

Thank you all very much,
Gabriele



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly

------=_Part_65397_23033031.1153167554040--