Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7309F9FB808 for ; Thu, 1 Mar 2007 17:09:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 16638-08 for ; Thu, 1 Mar 2007 17:09:17 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by postgresql.org (Postfix) with ESMTP id B1E7F9FB806 for ; Thu, 1 Mar 2007 17:09:19 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so1030398nfb for ; Thu, 01 Mar 2007 13:09:18 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=CYL/RjUTss8wiFUQV0gX9VAIahkPluDV6hyrpuxeI0jF5Ofzvs+PROcR5wO4lBRk/ZEdLI1X1KRfkKAsW6dIiJ3gbSxcY5lvwMwKHaK6mOZ093w4/OTbm3eXUGJnLt4cc9vZFTPpM4/l2pzJy+XjkTQv4BkJ1sxsxVGsKYijv3Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ezLQ9h/s40LVJAvj2L8ZbZnN3eNTt1E7xElpS5wjg/+bv2tMEYwsciIfZ2KGabnpabaN38DrATp7/HThrFfH/nSEximI9e4c9x/uqiHIj2qliCZB9YbRZkiPbPWay+jo64TeLF3z+m+CfEEHQawYONKDsvmEKT6HKrDOMDpVCsU= Received: by 10.49.41.12 with SMTP id t12mr6490468nfj.1172783357616; Thu, 01 Mar 2007 13:09:17 -0800 (PST) Received: by 10.49.75.11 with HTTP; Thu, 1 Mar 2007 13:09:17 -0800 (PST) Message-ID: <81961ff50703011309v43c0974eie31172e36f8460cd@mail.gmail.com> Date: Thu, 1 Mar 2007 16:09:17 -0500 From: "Chad Wagner" To: "Rob Schall" Subject: Re: Identical Queries Cc: "Stephan Szabo" , pgsql-performance@postgresql.org In-Reply-To: <45E73DA5.40808@callone.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_59040_10277637.1172783357575" References: <45E6F49D.3010707@callone.net> <20070301112948.R45862@megazone.bigpanda.com> <45E73DA5.40808@callone.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/19 X-Sequence-Number: 23424 ------=_Part_59040_10277637.1172783357575 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 3/1/07, Rob Schall wrote: > > 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. > Then the difference here has to do with using orignum vs destnum as the join criteria. There must be more intersections for orignum than destnum, or your statistics are so far out of whack. It appears to be estimating 5M vs 500K for a result set, and naturally it chose a different plan. ------=_Part_59040_10277637.1172783357575 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 3/1/07, Rob Schall <rschall@callone.net> wrote:
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.

Then the difference here has to do with using orignum vs destnum as the join criteria.  There must be more intersections for orignum than destnum, or your statistics are so far out of whack.  It appears to be estimating 5M vs 500K for a result set, and naturally it chose a different plan.
------=_Part_59040_10277637.1172783357575--