X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id C6140B43A09 for ; Mon, 7 Jul 2003 21:18:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 24239-04 for ; Mon, 7 Jul 2003 18:18:27 -0300 (ADT) Received: from patriot.simn.com (patriot.simn.com [199.5.214.34]) by svr1.postgresql.org (Postfix) with ESMTP id 7DCD1B439A8 for ; Mon, 7 Jul 2003 18:15:35 -0300 (ADT) Received: from mail.simn.com (mail.simn.com [10.0.0.106]) by patriot.simn.com (8.9.3/8.9.3) with ESMTP id PAA20081; Mon, 7 Jul 2003 15:18:48 -0600 Received: from there (wvmis224randy.simn.com [10.0.101.44]) by mail.simn.com (8.9.3/8.9.3) with SMTP id PAA52502; Mon, 7 Jul 2003 15:15:33 -0600 (MDT) (envelope-from randy@simn.com) Message-Id: <200307072115.PAA52502@mail.simn.com> Content-Type: text/plain; charset="iso-8859-1" From: Randy Neumann To: Greg Stark Subject: Re: optimizer picks smaller table to drive nested loops? Date: Mon, 7 Jul 2003 14:58:54 -0600 X-Mailer: KMail [version 1.3.1] References: <873chi2o53.fsf@stark.dyndns.tv> In-Reply-To: <873chi2o53.fsf@stark.dyndns.tv> Cc: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/134 X-Sequence-Number: 2427 On Monday 07 July 2003 12:22 pm, you wrote: > loops=1) -> Seq Scan on region (cost=0.00..2813.00 rows=2767 width=104) > (actual time=0.03..123.44 rows=2767 loops=2) Total runtime: 566.24 msec > (9 rows) > > (I'm also a bit puzzled why the optimizer is calculating that 2,813 * 2 = > 5,534) You should read it 2767 (rows) * 2 = 5534 (rows) 2813.00 is part of the cost.