X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 73F4E9DCBB2 for ; Tue, 28 Mar 2006 12:29:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00701-03 for ; Tue, 28 Mar 2006 12:29:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id 2E91C9DCBA4 for ; Tue, 28 Mar 2006 12:29:12 -0400 (AST) Received: from trofast.ipv6.sesse.net ([2001:700:300:dc03:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1FOH4A-0007UE-OI for pgsql-performance@postgresql.org; Tue, 28 Mar 2006 18:29:11 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1FOH48-0006v3-00 for ; Tue, 28 Mar 2006 18:29:08 +0200 Date: Tue, 28 Mar 2006 18:29:08 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: simple join uses indexes, very slow Message-ID: <20060328162908.GB26539@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20060327134733.72422d23.gry@ll.mit.edu> <00c901c65283$401f14d0$8300a8c0@tridecap.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <00c901c65283$401f14d0$8300a8c0@tridecap.com> X-Operating-System: Linux 2.6.14.3 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11+cvs20060126 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.09 required=5 tests=[AWL=0.090] X-Spam-Score: 0.09 X-Spam-Level: X-Archive-Number: 200603/546 X-Sequence-Number: 17983 On Tue, Mar 28, 2006 at 10:18:25AM -0600, Dave Dutcher wrote: >> "parameters_idx" btree (run, opset_num, step_num, opset, > opset_ver, >> step, step_ver, name, split, wafers) >> "parameters_opset_idx" btree (opset, step, name) >> "parameters_step_idx" btree (step, name) > Have you tried creating some different indexes on parameters? I don't > know if it should matter or not, but I would try some indexes like: > > (run, opset_num) //Without all the other columns > (opset_num, run) //Backwards > (opset_num) An index on (A,B,C) can be used for a query on (A,B) or (A), so it doesn't really matter. It isn't usable for a query on (B), (C) or (B,C), though. (The index rows will get bigger, of course, so you'll need more I/O if you want to scan large parts of it, but I guess that's beside the point.) /* Steinar */ -- Homepage: http://www.sesse.net/