X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 690AFD1B3DE for ; Fri, 14 May 2004 05:30:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 49436-02 for ; Fri, 14 May 2004 05:30:34 -0300 (ADT) Received: from mail.interlogica.org (host34-209.pool8174.interbusiness.it [81.74.209.34]) by svr1.postgresql.org (Postfix) with ESMTP id 82C9AD1B3DD for ; Fri, 14 May 2004 05:30:21 -0300 (ADT) Received: from [10.2.8.2] (helo=ilbug) by mail.interlogica.org with esmtp (Exim 3.16 #1) id 1BOYC4-0007sL-00; Fri, 14 May 2004 10:37:24 +0200 From: "Fabio Panizzutti" To: "'Tom Lane'" Cc: Subject: R: R: Query plan on identical tables differs . Why ? Date: Fri, 14 May 2004 10:40:24 +0200 Message-ID: <000f01c4398f$1a20cbc0$3c02020a@ufficio> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: <8904.1084460460@sss.pgh.pa.us> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/134 X-Sequence-Number: 6965 >>>-----Messaggio originale----- >>>Da: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 >>>Inviato: gioved=EC 13 maggio 2004 17.01 >>>A: Fabio Panizzutti >>>Cc: 'Shridhar Daithankar'; pgsql-performance@postgresql.org >>>Oggetto: Re: R: [PERFORM] Query plan on identical tables=20 >>>differs . Why ?=20 >>> >>> >>>"Fabio Panizzutti" writes: >>>> I don't understand why the planner chose a different query plan on=20 >>>> identical tables with same indexes . >>> >>>Different data statistics; not to mention different table=20 >>>sizes (the cost equations are not linear). >>> >>>Have you ANALYZEd (or VACUUM ANALYZEd) both tables recently? >>> >>>If the stats are up to date but still not doing the right=20 >>>thing, you might try increasing the statistics target for=20 >>>the larger table's tag_id column. See ALTER TABLE SET STATISTICS. >>> >>> regards, tom lane >>> All tables are vacumed and analyzed .=20 I try so set statistics to 1000 to tag_id columns with ALTER TABLE SET STATISTIC, revacuum analyze , but the planner choose the same query plan .=20 I'm trying now to change the indexes . Thanks=20