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 20114D1E8AB for ; Thu, 13 May 2004 10:05:52 -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 89477-10 for ; Thu, 13 May 2004 10:05:34 -0300 (ADT) Received: from frodo.hserus.net (frodo.hserus.net [204.74.68.40]) by svr1.postgresql.org (Postfix) with ESMTP id F2382D1B2DD for ; Thu, 13 May 2004 10:05:29 -0300 (ADT) Received: from concord.pspl.co.in ([202.54.11.72]:63114 helo=frodo.hserus.net) by frodo.hserus.net with asmtp (Cipher TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.34 #0) id 1BOFtt-0004WL-EG by authid with plain; Thu, 13 May 2004 18:35:25 +0530 Message-ID: <40A3728F.2030402@frodo.hserus.net> Date: Thu, 13 May 2004 18:35:19 +0530 From: Shridhar Daithankar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Fabio Panizzutti Cc: pgsql-performance@postgresql.org Subject: Re: Query plan on identical tables differs . Why ? References: <005c01c438e7$ced25c30$3c02020a@ufficio> In-Reply-To: <005c01c438e7$ced25c30$3c02020a@ufficio> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/120 X-Sequence-Number: 6951 Fabio Panizzutti wrote: > storico=# explain select tag_id,valore_tag,data_tag from storico_misure > where (data_tag>'2004-05-03' and data_tag <'2004-05-12') and > tag_id=37423 ; Can you please post explain analyze? That includes actual timings. Looking at the schema, can you try "and tag_id=37423::integer" instead? > enable_hashagg = false > enable_hashjoin = false > enable_indexscan = true > enable_mergejoin = true > enable_nestloop = false > enable_seqscan = true > enable_sort = false > enable_tidscan = false Why do you have these off? AFAIK, 7.4 improved hash aggregates a lot. So you might miss on these in this case. > # - Planner Cost Constants - > > #effective_cache_size = 1000 # typically 8KB each You might set it to something realistic. And what is your hardware setup? Disks/CPU/RAM? Just to be sure, you went thr. http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html and http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html? HTH Regards Shridhar