X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6B6895E46DF for ; Fri, 20 Aug 2004 09:55:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97563-04 for ; Fri, 20 Aug 2004 12:55:50 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id 593A95E46CF for ; Fri, 20 Aug 2004 09:55:46 -0300 (ADT) Received: from [134.22.71.19] (dyn-71-19.tor.dsl.tht.net [134.22.71.19]) by tht.net (Postfix) with ESMTP id 0B9EF76A2B; Fri, 20 Aug 2004 08:55:52 -0400 (EDT) Subject: Re: using an index worst performances From: Rod Taylor To: Gaetano Mendola Cc: Christopher Kings-Lynne , Richard Huxton , Postgresql Performance In-Reply-To: <4125C657.7000702@bigfoot.com> References: <4124ECF3.6040901@archonet.com> <412505F6.6080000@bigfoot.com> <4125565D.3060008@familyhealth.com.au> <4125C657.7000702@bigfoot.com> Content-Type: text/plain Message-Id: <1093006549.75942.61.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 20 Aug 2004 08:55:49 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/298 X-Sequence-Number: 7934 On Fri, 2004-08-20 at 05:37, Gaetano Mendola wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Christopher Kings-Lynne wrote: > > |>>> Without index: 1.140 ms > |>>> With index: 1.400 ms > |>>> With default_statistic_targer = 200: 1.800 ms > |>> > |>> > |>> > |>> > |>> Can I just check that 1.800ms means 1.8 secs (You're using . as the > |>> thousands separator)? > |>> > |>> If it means 1.8ms then frankly the times are too short to mean > |>> anything without running them 100 times and averaging. > |> > |> > |> > |> > |> It mean 1.8 ms and that execution time is sticky to that value even > |> with 1000 times. > | > | > | Given the almost irrelvant difference in the speed of those queries, I'd > | say that with the stats so high, postgres simply takes longer to check > | the statistics to come to the same conclusion. ie. it has to loop over > | 200 rows instead of just 10. > > The time increase seems too much. We can test this. What are the times without the index, with the index and with the higher statistics value when using a prepared query?