X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id CBBA4D1B550 for ; Fri, 3 Oct 2003 05:29:15 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 51766-10 for ; Fri, 3 Oct 2003 02:28:26 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 5DFB9D1B503 for ; Fri, 3 Oct 2003 02:28:25 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3715721; Thu, 02 Oct 2003 22:28:52 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Oleg Lebedev , "scott.marlowe" Subject: Re: TPC-R benchmarks Date: Thu, 2 Oct 2003 22:27:08 -0700 User-Agent: KMail/1.4.3 Cc: "pgsql-performance@postgresql.org" References: <993DBE5B4D02194382EC8DF8554A52731E783E@postoffice.waterford.org> In-Reply-To: <993DBE5B4D02194382EC8DF8554A52731E783E@postoffice.waterford.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310022227.08554.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/76 X-Sequence-Number: 3824 Oleg, > I have another question. How do I optimize my indexes for the query that > contains a lot of ORed blocks, each of which contains a bunch of ANDed > expressions? The structure of each ORed block is the same except the > right-hand-side values vary. Given the example, I'd do a multicolumn index on p_brand, p_container, p_size and a second multicolumn index on l_partkey, l_quantity, l_shipmode. Hmmm ... or maybe seperate indexes, one on l_partkey and one on l_quantity, l_shipmode & l_instruct. Test both configurations. Mind you, if this is also an OLTP table, then you'd want to test those multi-column indexes to determine the least columns you need for the indexes still to be used, since more columns = more index maintainence. -- Josh Berkus Aglio Database Solutions San Francisco