X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2B0BC475D91 for ; Mon, 28 Apr 2003 14:32:46 -0400 (EDT) Received: from flake.decibel.org (flake.decibel.org [66.93.216.19]) by postgresql.org (Postfix) with SMTP id 7700E475B47 for ; Mon, 28 Apr 2003 14:32:44 -0400 (EDT) Received: (qmail 96396 invoked by uid 1001); 28 Apr 2003 18:32:44 -0000 Date: Mon, 28 Apr 2003 13:32:44 -0500 From: "Jim C. Nasby" To: pgsql-performance@postgresql.org Subject: Re: How to get the optimizer to use an index with multiple fields Message-ID: <20030428133244.K66185@flake.decibel.org> Reply-To: jim@nasby.net References: <20030428132143.J66185@flake.decibel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030428132143.J66185@flake.decibel.org>; from jim@nasby.net on Mon, Apr 28, 2003 at 01:21:43PM -0500 X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net X-Spam-Status: No, hits=-38.6 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE, USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/232 X-Sequence-Number: 1738 On Mon, Apr 28, 2003 at 01:21:43PM -0500, Jim C. Nasby wrote: > I tried changing this to an EXISTS and it takes over a minute. So in > this case, the range of runtimes is ~4 seconds (building the temp table > takes ~0.25 seconds) to over a minute. BTW, I forgot to mention that building the temp table only takes 0.25 seconds if I first disable sequential scans. :/ -- Jim C. Nasby (aka Decibel!) jim@nasby.net Member: Triangle Fraternity, Sports Car Club of America Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"