Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9AE152E2DAE for ; Mon, 26 Nov 2007 17:53:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 51543-01 for ; Mon, 26 Nov 2007 17:53:48 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 088BE2E2D6F for ; Mon, 26 Nov 2007 17:53:47 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lAQLrjww004141; Mon, 26 Nov 2007 16:53:45 -0500 (EST) To: Ehab Galal cc: "pgsql-sql@postgresql.org" Subject: Re: materialize In-reply-to: References: <14450.1194194136@sss.pgh.pa.us> Comments: In-reply-to Ehab Galal message dated "Mon, 26 Nov 2007 16:17:14 -0500" Date: Mon, 26 Nov 2007 16:53:45 -0500 Message-ID: <4140.1196114025@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/132 X-Sequence-Number: 29660 Ehab Galal writes: > I was wondering why do we need the Materialize node in the plan below when i explain a query? It's cheaper to scan a materialized rowset many times than a raw table --- we don't need to re-access shared memory nor re-check row visibility. regards, tom lane