Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 046699FB5C2 for ; Thu, 1 Mar 2007 16:55:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 48320-04 for ; Thu, 1 Mar 2007 16:55:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.callone.net (www.jidn.com [64.200.215.50]) by postgresql.org (Postfix) with ESMTP id 50DFA9FB66A for ; Thu, 1 Mar 2007 16:55:14 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.callone.net (Postfix) with ESMTP id CBAFECDEB2; Thu, 1 Mar 2007 14:55:12 -0600 (CST) X-Quarantine-ID: X-Virus-Scanned: amavisd-new at callone.net Received: from mail.callone.net ([127.0.0.1]) by localhost (mail.callone.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kto4hGc2dH6g; Thu, 1 Mar 2007 14:55:01 -0600 (CST) Received: from [192.168.1.131] (rschall.callone.net [192.168.1.131]) by mail.callone.net (Postfix) with ESMTP id 3CEC6CE579; Thu, 1 Mar 2007 14:55:01 -0600 (CST) Message-ID: <45E73DA5.40808@callone.net> Date: Thu, 01 Mar 2007 14:55:01 -0600 From: Rob Schall User-Agent: Thunderbird 1.5.0.7 (X11/20061011) MIME-Version: 1.0 To: Stephan Szabo CC: pgsql-performance@postgresql.org Subject: Re: Identical Queries References: <45E6F49D.3010707@callone.net> <20070301112948.R45862@megazone.bigpanda.com> In-Reply-To: <20070301112948.R45862@megazone.bigpanda.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.367 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/16 X-Sequence-Number: 23421 There are 4 entries (wanted to make the playing field level for this test). There are 2 with true for istf and 2 with false. Rob Stephan Szabo wrote: > On Thu, 1 Mar 2007, Rob Schall wrote: > > >> Question for anyone... >> >> I tried posting to the bugs, and they said this is a better question for here. >> I have to queries. One runs in about 2 seconds. The other takes upwards >> of 2 minutes. I have a temp table that is created with 2 columns. This >> table is joined with the larger database of call detail records. >> However, these 2 queries are handled very differently. >> > > How many rows are there in anitmp and how many rows in anitmp have > istf=true and how many have istf=false? If you don't currently analyze the > temp table after adding the rows, you might find that doing an analyze > helps, or at least makes the row estimates better. >