Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E0BAB9FB309 for ; Tue, 13 Mar 2007 09:29:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 69014-02 for ; Tue, 13 Mar 2007 09:29:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cluster-b.mailcontrol.com (cluster-b.mailcontrol.com [217.68.146.190]) by postgresql.org (Postfix) with ESMTP id D1D2E9FB2AC for ; Tue, 13 Mar 2007 09:29:54 -0300 (ADT) Received: from rly05b.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly05b.srv.mailcontrol.com (MailControl) with ESMTP id l2DCTlqb016111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 13 Mar 2007 12:29:51 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly05b.srv.mailcontrol.com (MailControl) id l2DCTBES014723 for pgsql-performance@postgresql.org; Tue, 13 Mar 2007 12:29:11 GMT Received: from mail.leroymerlin.fr (lewebquivabien.leroymerlin.fr [195.25.212.55]) by rly05b-eth0.srv.mailcontrol.com (envelope-sender vincent.moreau@leroymerlin.fr) (MIMEDefang) with ESMTP id l2DCSXJ0013692; Tue, 13 Mar 2007 12:29:11 +0000 (GMT) Received: from cmailf1.corp.leroymerlin.com ([10.5.3.20]) by mail.leroymerlin.fr (Lotus Domino Release 5.0.13a) with ESMTP id 2007031313201379:1680387 ; Tue, 13 Mar 2007 13:20:13 +0100 Received: from [10.2.50.136] ([10.2.50.136]) by cmailf1.corp.leroymerlin.com (MOS 3.8.2-GA) with ESMTP id BHJ00441 (AUTH vincent.moreau@leroymerlin.fr); Tue, 13 Mar 2007 13:28:07 +0100 (WAT) Message-ID: <45F698F4.8030601@leroymerlin.fr> Date: Tue, 13 Mar 2007 13:28:36 +0100 From: Organization: leroy merlin User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Richard Huxton CC: Michael Fuhr , pgsql-performance@postgresql.org Subject: Re: Execution plan changed after upgrade from 7.3.9 to 8.2.3 References: <45F65EA3.1030706@leroymerlin.fr> <20070313101117.GA98241@winnie.fuhr.org> <45F686FA.2090909@leroymerlin.fr> <45F68A73.3070104@archonet.com> In-Reply-To: <45F68A73.3070104@archonet.com> X-MIMETrack: Itemize by SMTP Server on DMZSMTP/France/Leroy Merlin(Release 5.0.13a |April 8, 2004) at 13/03/2007 13:20:13, Serialize by Router on DMZSMTP/France/Leroy Merlin(Release 5.0.13a |April 8, 2004) at 13/03/2007 13:20:48, Serialize complete at 13/03/2007 13:20:48 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Scanned-By: MailControl A-07-06-85 (www.mailcontrol.com) on 10.66.1.115 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/215 X-Sequence-Number: 23620 Thanks for the update. The following did not change anything in the execution plan ALTER TABLE lm05_t_tarif_panneau ALTER COLUMN lrg_min SET STATISTICS 1000 ALTER TABLE lm05_t_tarif_panneau ALTER COLUMN lrg_max SET STATISTICS 1000 ANALYZE lm05_t_tarif_panneau I was able to improve response time by creating indexes, but I would like to avoid changing the database structure because it is not maintained by ourseleves, but by the third party vendor. Richard Huxton wrote: > vincent.moreau@leroymerlin.fr wrote: >> I have attached the requested information. >> >> You will see that the query is quite messy and could be easily improved. >> Unfortunately, it came from a third party application and we do not >> have access to the source code. > > -> Hash Join (cost=6.31..3056.17 rows=116 width=47) (actual > time=60.055..70.078 rows=48 loops=280) > Hash Cond: (g.cod_modele = a.cod_modele) > -> Seq Scan on lm05_t_tarif_panneau g (cost=0.00..2977.08 > rows=19097 width=43) (actual time=0.008..67.670 rows=4062 loops=280) > > It does seem to be running that sequential scan 280 times, which is a > strange choice to say the least. > > Obvious thing #1 is to look at I'd say is the stats on lrg_min,lrg_max > - try something like: > ALTER TABLE lm05_t_tarif_panneau ALTER COLUMN lrg_min SET STATISTICS > You can set up to 1000 (and then the same for lrg_max of course). > Analyse the table again and see if that gives it a clue. > > Second thing might be to try indexes on lrg_min and lrg_max and see if > the bitmap code in 8.2 helps things. > > Very strange plan. Ce message et toutes les pièces jointes sont établis à l'attention exclusive de leurs destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le détruire et d'en avertir immédiatement l'expéditeur. L'internet ne permettant pas d'assurer l'intégrité de ce message, le contenu de ce message ne représente en aucun cas un engagement de la part de Leroy Merlin.