X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id C671E30E75C for ; Tue, 10 Jun 2003 20:56:58 +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 37676-10 for ; Tue, 10 Jun 2003 17:56:48 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id BDB0130E4F3 for ; Tue, 10 Jun 2003 17:56:47 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h5AKujU6004800; Tue, 10 Jun 2003 16:56:45 -0400 (EDT) To: jim@nasby.net Cc: pgsql-performance@postgresql.org Subject: Re: Hash or merge join instead of inner loop In-reply-to: <20030610194206.GK40542@flake.decibel.org> References: <20030609204009.GJ40542@flake.decibel.org> <274.1055225711@sss.pgh.pa.us> <20030610194206.GK40542@flake.decibel.org> Comments: In-reply-to "Jim C. Nasby" message dated "Tue, 10 Jun 2003 14:42:07 -0500" Date: Tue, 10 Jun 2003 16:56:45 -0400 Message-ID: <4799.1055278605@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200306/42 X-Sequence-Number: 2126 "Jim C. Nasby" writes: > On Tue, Jun 10, 2003 at 02:15:11AM -0400, Tom Lane wrote: >> ... In reality, most of the upper btree levels will no doubt >> stay in memory during such a query, and so this estimate charges many >> more reads than really occur. Fixing this is on the todo list, but no >> one's got to it yet. (It's not clear to me how to put the consideration >> into the planner's cost algorithms in a clean way.) > What about just ignoring all but the leaf pages? IIRC, we already know what cost model we want to use. The problem is that the planner's code structure makes it difficult for the indexscan coster to know that the indexscan will be applied repeatedly rather than just once. That's what has to be solved. regards, tom lane