X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id E5F799FA25A for ; Sun, 16 Jul 2006 15:08:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 21317-01 for ; Sun, 16 Jul 2006 18:08:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from joeconway.com (wsip-68-15-9-201.sd.sd.cox.net [68.15.9.201]) by postgresql.org (Postfix) with ESMTP id 8901D9FA21D for ; Sun, 16 Jul 2006 15:08:09 -0300 (ADT) Received: from [192.168.4.40] (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 4051478; Sun, 16 Jul 2006 11:08:07 -0700 Message-ID: <44BA8087.9010007@joeconway.com> Date: Sun, 16 Jul 2006 11:08:07 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.13) Gecko/20060501 Fedora/1.7.13-1.1.fc5 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gabriele Turchi CC: Michael Fuhr , pgsql-performance@postgresql.org, Marco Colombo Subject: Re: Big differences in plans between 8.0 and 8.1 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> In-Reply-To: <1152994970.3541.31.camel@apollo5.casa.intranet> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/156 X-Sequence-Number: 20016 Gabriele Turchi wrote: > Il giorno sab, 15/07/2006 alle 13.04 -0700, Joe Conway ha scritto: >>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? One thing I noticed is that in both plans there is a seq scan on registrazioni. Given that performance degrades so quickly as records are inserted into registrazioni, I'm wondering if you're missing an index. What indexes do you have on registrazioni? Joe