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 E946F3F52DE for ; Sun, 26 Dec 2004 12:28:35 +0000 (GMT) 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 06429-09 for ; Sun, 26 Dec 2004 12:28:28 +0000 (GMT) Received: from poros.telenet-ops.be (poros.telenet-ops.be [195.130.132.44]) by svr1.postgresql.org (Postfix) with ESMTP id 1281B3F52D5 for ; Sun, 26 Dec 2004 12:28:30 +0000 (GMT) Received: from localhost (localhost.localdomain [127.0.0.1]) by poros.telenet-ops.be (Postfix) with SMTP id CAD323BC1D5; Sun, 26 Dec 2004 13:28:29 +0100 (MET) Received: from localhost.localdomain (d54C27BB6.kabel.telenet.be [84.194.123.182]) by poros.telenet-ops.be (Postfix) with ESMTP id 9CCD83BC189; Sun, 26 Dec 2004 13:28:29 +0100 (MET) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.1/8.13.1) with ESMTP id iBQCUsBk013613; Sun, 26 Dec 2004 13:30:54 +0100 Received: (from kvo@localhost) by localhost.localdomain (8.13.1/8.13.1/Submit) id iBQCUGe3013499; Sun, 26 Dec 2004 13:30:16 +0100 To: Yann Michel Cc: pgsql-performance@postgresql.org Subject: Re: Why so much time difference with a same query/plan? References: <20041222200904.94015.qmail@web13124.mail.yahoo.com> <20041222215240.12345.qmail@web13124.mail.yahoo.com> <20041223070453.GA30031@zong.spline.inf.fu-berlin.de> From: Karl Vogel Date: Sun, 26 Dec 2004 13:30:15 +0100 In-Reply-To: <20041223070453.GA30031@zong.spline.inf.fu-berlin.de> (Yann Michel's message of "Thu, 23 Dec 2004 08:04:53 +0100") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/312 X-Sequence-Number: 9687 Yann Michel writes: > On Wed, Dec 22, 2004 at 01:52:40PM -0800, Litao Wu wrote: >> Does the order of columns in the index matter since >> more than 50% customer_id = 158? >> >> I think it does not in Oracle. >> >> Will the performance be better if I change index >> xxx_idx to ("domain", customer_id, created)? > > Well, in Oracle this would of cause matter. Oracle calculates index > usage by being able to fill all index's attributes from the left to the > right. If any one attribute within is missing Oracle would not test if > it is only one attribute missing, or if all other attributes are missing > within the query's where clause. This depends on the version of Oracle you're using. Oracle 9i introduced Index Skip Scans: http://www.oracle.com/technology//products/oracle9i/daily/apr22.html I don't know whether pg has something similar?