Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6E1499FB277 for ; Sat, 30 Sep 2006 06:50:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 89938-10 for ; Sat, 30 Sep 2006 06:50:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 7C8029FA473 for ; Sat, 30 Sep 2006 06:50:51 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (p549D0284.dip0.t-ipconnect.de [84.157.2.132]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 8C01B65993; Sat, 30 Sep 2006 11:53:13 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 2EDB818814223; Sat, 30 Sep 2006 11:50:34 +0200 (CEST) Message-ID: <451E3DE9.80307@logix-tt.com> Date: Sat, 30 Sep 2006 11:50:33 +0200 From: Markus Schaber Reply-To: PostgreSQL Performance List Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Cc: gurkan@resolution.com Subject: Re: how to optimize postgres 8.1 References: <1159549965.451d540d3a997@www.resolution.com> In-Reply-To: <1159549965.451d540d3a997@www.resolution.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/442 X-Sequence-Number: 21128 Hi, Gurkan, gurkan@resolution.com wrote: > If I run the query below with informix, it gives cost=107. > with postgres with additional indexes it gives cost=407, before the additional > indexes it was even much slower What are your real timing measurements, in a produciton-like setup in a production-like load? That's the only kind of "benchmarking" that will give you an useful comparison. You cannot compare anything else. Especially, you cannot compare those "artificial" cost estimator values, as they are likely to be defined differently for PostgreSQL and Informix. For PostgreSQL, they are relative values to the cost of reading a page as part of a sequential scan. And those values are tunable - fiddle with the random_page_cost and cpu_*_cost values in the postgresql.conf, and you will see very different values compared to the 407 you see now, even if the query plan stays equal. Do you look up the definition of cost for Informix? Have you made shure that they're comparable? HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org