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 81BFFD1B3D6 for ; Fri, 14 May 2004 06:13:09 -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 55762-06 for ; Fri, 14 May 2004 06:12:49 -0300 (ADT) Received: from mail.interlogica.org (host34-209.pool8174.interbusiness.it [81.74.209.34]) by svr1.postgresql.org (Postfix) with ESMTP id 6AFCCD1B3C6 for ; Fri, 14 May 2004 06:12:46 -0300 (ADT) Received: from [10.2.8.2] (helo=ilbug) by mail.interlogica.org with esmtp (Exim 3.16 #1) id 1BOYr2-0000AP-00; Fri, 14 May 2004 11:19:44 +0200 From: "Fabio Panizzutti" To: "'Manfred Koizar'" Cc: Subject: R: R: Query plan on identical tables differs . Why ? Date: Fri, 14 May 2004 11:22:44 +0200 Message-ID: <001101c43995$03e8b830$3c02020a@ufficio> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 In-Reply-To: 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/136 X-Sequence-Number: 6967 >>>> Index Scan using pk_storico_misure_2 on storico_misure >>>>(cost=0.00..1984.64 rows=658 width=21) (actual >>>time=723.441..1858.107 >>>>rows=835 loops=1) >>>> Index Cond: ((data_tag > '2004-05-03 >>>00:00:00'::timestamp without >>>>time zone) AND (data_tag < '2004-05-12 00:00:00'::timestamp without >>>>time >>>>zone) AND (tag_id = 37423)) >>> >>>Either most of the time is spent skipping index tuples in >>>the data_tag range 2004-05-03 to 2004-05-12 which have >>>tag_id <> 37423, or getting those 835 rows causes a lot of >>>disk seeks. >>> >>>If the former is true, an index on (tag_id, data_tag) will help. >>> Is true , i recreate the indexes making an index on (tag_id, data_tag) and works fine . >>>In your first message you wrote: >>>>fsync = false >>> >>>Do this only if you don't care for your data. >>> I set it to false , for performance tests .I've a stored procedure that make about 2000 insert in 2 tables and 2000 delete in another and with fsync false perfomrmance are 2.000 -3.000 ms (stable) with fsync 3.000 ms to 15.000 ms . I trust in my hardware an O.S so fsync setting is a big dubt for my production enviroment . Thanks a lot Bye